fa10beec52
gcc/ * cgraph.c: Fix typos in comments. (cgraph_availability_names): Fix string typo. * fold-const.c: Fix typos in comments. (fold_binary): Fix typo in warning. * genautomata.c: Fix typos in comments. (check_presence_pattern_sets): Fix typo in local variable. (output_description): Fix typo in output. * ggc-zone.c (ggc_pch_finish): Fix typo in error message. * hwint.h: Likewise. * matrix-reorg.c (check_allocation_function): Likewise. * omega.c (smooth_weird_equations): Likewise. * auto-inc-dec.c: Fix typos in comments. * bb-reorder.c: Likewise. * builtins.c: Likewise. * c-common.c: Likewise. * c-cppbuiltin.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfglayout.c: Likewise. * cfgloopmanip.c: Likewise. * cgraphunit.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * dse.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * function.c: Likewise. * function.h: Likewise. * gcc.c: Likewise. * gcov-io.c: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattrtab.c: Likewise. * ggc-page.c: Likewise. * gimplify.c: Likewise. * gthr-lynx.h: Likewise. * haifa-sched.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa.c: Likewise. * loop-doloop.c: Likewise. * mips-tfile.c: Likewise. * mkmap-flat.awk: Likewise. * mkmap-symver.awk: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts.c: Likewise. * passes.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * pretty-print.h: Likewise. * profile.c: Likewise. * protoize.c: Likewise. * ra-conflict.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * regclass.c: Likewise. * regs.h: Likewise. * reload.c: Likewise. * rtl-error.c: Likewise. * rtlanal.c: Likewise. * scan.h: Likewise. * sched-rgn.c: Likewise. * see.c: Likewise. * stmt.c: Likewise. * target.h: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa.c: Likewise. * tree-vect-analyze.c: Likewise. * tree-vect-transform.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vn.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * unwind-dw2-fde.c: Likewise. * unwind.inc: Likewise. * value-prof.c: Likewise. * vmsdbgout.c: Likewise. From-SVN: r136425
125 lines
3.5 KiB
C
125 lines
3.5 KiB
C
/* RTL specific diagnostic subroutines for GCC
|
|
Copyright (C) 2001, 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
|
|
Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
|
|
|
|
This file is part of GCC.
|
|
|
|
GCC is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3, or (at your option)
|
|
any later version.
|
|
|
|
GCC is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with GCC; see the file COPYING3. If not see
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
#include "config.h"
|
|
#undef FLOAT /* This is for hpux. They should change hpux. */
|
|
#undef FFS /* Some systems define this in param.h. */
|
|
#include "system.h"
|
|
#include "coretypes.h"
|
|
#include "tm.h"
|
|
#include "rtl.h"
|
|
#include "insn-attr.h"
|
|
#include "insn-config.h"
|
|
#include "input.h"
|
|
#include "toplev.h"
|
|
#include "intl.h"
|
|
#include "diagnostic.h"
|
|
|
|
static location_t location_for_asm (const_rtx);
|
|
static void diagnostic_for_asm (const_rtx, const char *, va_list *, diagnostic_t) ATTRIBUTE_GCC_DIAG(2,0);
|
|
|
|
/* Figure the location of the given INSN. */
|
|
static location_t
|
|
location_for_asm (const_rtx insn)
|
|
{
|
|
rtx body = PATTERN (insn);
|
|
rtx asmop;
|
|
location_t loc;
|
|
|
|
/* Find the (or one of the) ASM_OPERANDS in the insn. */
|
|
if (GET_CODE (body) == SET && GET_CODE (SET_SRC (body)) == ASM_OPERANDS)
|
|
asmop = SET_SRC (body);
|
|
else if (GET_CODE (body) == ASM_OPERANDS)
|
|
asmop = body;
|
|
else if (GET_CODE (body) == PARALLEL
|
|
&& GET_CODE (XVECEXP (body, 0, 0)) == SET)
|
|
asmop = SET_SRC (XVECEXP (body, 0, 0));
|
|
else if (GET_CODE (body) == PARALLEL
|
|
&& GET_CODE (XVECEXP (body, 0, 0)) == ASM_OPERANDS)
|
|
asmop = XVECEXP (body, 0, 0);
|
|
else
|
|
asmop = NULL;
|
|
|
|
if (asmop)
|
|
loc = ASM_OPERANDS_SOURCE_LOCATION (asmop);
|
|
else
|
|
loc = input_location;
|
|
return loc;
|
|
}
|
|
|
|
/* Report a diagnostic MESSAGE (an error or a WARNING) at the line number
|
|
of the insn INSN. This is used only when INSN is an `asm' with operands,
|
|
and each ASM_OPERANDS records its own source file and line. */
|
|
static void
|
|
diagnostic_for_asm (const_rtx insn, const char *msg, va_list *args_ptr,
|
|
diagnostic_t kind)
|
|
{
|
|
diagnostic_info diagnostic;
|
|
|
|
diagnostic_set_info (&diagnostic, msg, args_ptr,
|
|
location_for_asm (insn), kind);
|
|
report_diagnostic (&diagnostic);
|
|
}
|
|
|
|
void
|
|
error_for_asm (const_rtx insn, const char *gmsgid, ...)
|
|
{
|
|
va_list ap;
|
|
|
|
va_start (ap, gmsgid);
|
|
diagnostic_for_asm (insn, gmsgid, &ap, DK_ERROR);
|
|
va_end (ap);
|
|
}
|
|
|
|
void
|
|
warning_for_asm (const_rtx insn, const char *gmsgid, ...)
|
|
{
|
|
va_list ap;
|
|
|
|
va_start (ap, gmsgid);
|
|
diagnostic_for_asm (insn, gmsgid, &ap, DK_WARNING);
|
|
va_end (ap);
|
|
}
|
|
|
|
void
|
|
_fatal_insn (const char *msgid, const_rtx insn, const char *file, int line,
|
|
const char *function)
|
|
{
|
|
error ("%s", _(msgid));
|
|
|
|
/* The above incremented error_count, but isn't an error that we want to
|
|
count, so reset it here. */
|
|
errorcount--;
|
|
|
|
debug_rtx (insn);
|
|
fancy_abort (file, line, function);
|
|
}
|
|
|
|
void
|
|
_fatal_insn_not_found (const_rtx insn, const char *file, int line,
|
|
const char *function)
|
|
{
|
|
if (INSN_CODE (insn) < 0)
|
|
_fatal_insn ("unrecognizable insn:", insn, file, line, function);
|
|
else
|
|
_fatal_insn ("insn does not satisfy its constraints:",
|
|
insn, file, line, function);
|
|
}
|