int flag_no_asm;
-/* Nonzero means don't recognize the non-ANSI builtin functions. */
+/* Nonzero means don't recognize any builtin functions. */
int flag_no_builtin;
+/* Nonzero means don't recognize the non-ANSI builtin functions.
+ -ansi sets this. */
+
+int flag_no_nonansi_builtin;
+
/* Nonzero means do some things the same way PCC does. */
int flag_traditional;
else if (!strcmp (p, "-fident"))
flag_no_ident = 0;
else if (!strcmp (p, "-ansi"))
- flag_no_asm = 1, flag_no_builtin = 1, dollars_in_ident = 0;
+ flag_no_asm = 1, flag_no_nonansi_builtin = 1, dollars_in_ident = 0;
else if (!strcmp (p, "-Wimplicit"))
warn_implicit = 1;
else if (!strcmp (p, "-Wno-implicit"))
; /* cpp handles this one. */
else if (!strcmp (p, "-Wno-trigraphs"))
; /* cpp handles this one. */
+ else if (!strcmp (p, "-Wimport"))
+ ; /* cpp handles this one. */
+ else if (!strcmp (p, "-Wno-import"))
+ ; /* cpp handles this one. */
else if (!strcmp (p, "-Wall"))
{
extra_warnings = 1;
warning_with_decl (newdecl,
"`%s' declared inline after being called");
if (TREE_CODE (olddecl) == FUNCTION_DECL
- && TREE_INLINE (olddecl) != TREE_INLINE (newdecl))
+ && TREE_INLINE (olddecl) != TREE_INLINE (newdecl)
+ && ! (TREE_EXTERNAL (olddecl) && TREE_EXTERNAL (newdecl)))
warning_with_decl (newdecl,
"`%s' declarations disagree about `inline'");
/* It is nice to warn when a function is declared
sizetype,
endlink)),
BUILT_IN_ALLOCA, "alloca");
- if (! flag_no_builtin)
+ if (! flag_no_builtin && !flag_no_nonansi_builtin)
{
tree exit_type;
temp = builtin_function ("alloca",
saveable_tree_cons (NULL_TREE, void_type_node, NULL_TREE));
}
- /* Extract enumerator values and other non-parms declared with the parms. */
+ /* Extract enumerator values and other non-parms declared with the parms.
+ Likewise any forward parm decls that didn't have real parm decls. */
for (decl = parms; decl; )
{
tree next = TREE_CHAIN (decl);
+ if (TREE_ASM_WRITTEN (decl))
+ {
+ error_with_decl (decl, "no real declaration for parameter `%s'");
+ TREE_CHAIN (decl) = new_parms;
+ new_parms = decl;
+ }
if (TREE_CODE (decl) != PARM_DECL)
{
TREE_CHAIN (decl) = new_parms;
case 'F':
output_addr_const (file, x);
- if (! strcmp (XSTR (x, 0), current_function_name)
- && dbr_sequence_length () == 0)
- fprintf (file, "+4\n\t%s,%d",
- a29k_regstack_size >= 64 ? "const gr121" : "sub gr1,gr1",
- a29k_regstack_size * 4);
+ if (dbr_sequence_length () == 0)
+ {
+ if (! strcmp (XSTR (x, 0), current_function_name))
+ fprintf (file, "+4\n\t%s,%d",
+ a29k_regstack_size >= 64 ? "const gr121" : "sub gr1,gr1",
+ a29k_regstack_size * 4);
+ else
+ fprintf (file, "\n\tnop");
+ }
return;
case 'L':
XVECLEN (PATTERN (TABLE), 1) + 1, (PREFIX), (NUM), \
(PREFIX), (NUM), (PREFIX), (NUM))
-/* At end of a switch table, define LD%n iff the symbol LI%n was defined. */
-#define ASM_OUTPUT_CASE_END(FILE,NUM,TABLE) \
- if (RTX_INTEGRATED_P (TABLE)) \
- fprintf (FILE, "\tset LD%%%d,L%%%d-LI%%%d\n", (NUM), (NUM), (NUM))
+/* At end of a switch table, define LDnnn iff the symbol LInnn was defined.
+ Some SGS assemblers have a bug such that "Lnnn-LInnn-2.b(pc,d0.l*2)"
+ fails to assemble. Luckily "LDnnn(pc,d0.l*2)" produces the results
+ we want. This difference can be accommodated by making the assembler
+ define such "LDnnn" to be either "Lnnn-LInnn-2.b", "Lnnn", or any other
+ string, as necessary. This is accomplished via the ASM_OUTPUT_CASE_END
+ macro. */
+
+#define ASM_OUTPUT_CASE_END(FILE,NUM,TABLE) \
+{ if (switch_table_difference_label_flag) \
+ fprintf (FILE, "\tset LD%%%d,L%%%d-LI%%%d\n", (NUM), (NUM), (NUM)) \
+ switch_table_difference_label_flag = 0; }
+
+int switch_table_difference_label_flag;
#define ASM_OUTPUT_OPCODE(FILE, PTR) \
{ if ((PTR)[0] == 'j' && (PTR)[1] == 'b') \
/* At end of a switch table, define LDnnn iff the symbol LInnn was defined.
Some SGS assemblers have a bug such that "Lnnn-LInnn-2.b(pc,d0.l*2)"
fails to assemble. Luckily "Lnnn(pc,d0.l*2)" produces the results
- we want. This difference can be accommodated by using an assembler
+ we want. This difference can be accommodated by making the assembler
define such "LDnnn" to be either "Lnnn-LInnn-2.b", "Lnnn", or any other
string, as necessary. This is accomplished via the ASM_OUTPUT_CASE_END
macro. (the Amiga assembler has this bug) */
#undef ASM_OUTPUT_CASE_END
#define ASM_OUTPUT_CASE_END(FILE,NUM,TABLE) \
do { \
- if (RTX_INTEGRATED_P (TABLE)) \
+ if (switch_table_difference_label_flag) \
asm_fprintf ((FILE), "%s %LLD%d,%LL%d\n", SET_ASM_OP, (NUM), (NUM));\
+ switch_table_difference_label_flag = 0;
} while (0)
+int switch_table_difference_label_flag;
+
/* This says how to output assembler code to declare an
uninitialized external linkage data object. Under SVR4,
the linker seems to want the alignment of data objects
#else /* SGS_SWITCH_TABLES or not MOTOROLA */
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"LI\",
CODE_LABEL_NUMBER (XEXP (labelref, 0)));
- /* For sake of 3b1, set flag saying we need to define the symbol
- LD%n (with value L%n-LI%n) at the end of the switch table. */
- RTX_INTEGRATED_P (next_real_insn (XEXP (labelref, 0))) = 1;
+ /* Set flag saying we need to define the symbol
+ LD%n (with value L%n-LI%n) at the end of the switch table. */
+ switch_table_difference_label_flag = 1;
#endif /* SGS_SWITCH_TABLES or not MOTOROLA */
}
#endif /* SGS_NO_LI */
main_input_filename, ".ro_"); \
\
toc_section (); \
- bss_section (); \
if (write_symbols != NO_DEBUG) \
private_data_section (); \
}
fprintf (asm_out_file, "\t.toc\n"); \
\
in_section = toc; \
-} \
- \
-void \
-bss_section () \
-{ \
- if (in_section != bss) \
- { \
- fprintf (asm_out_file, "\t.csect %s[BS]\n", \
- xcoff_bss_section_name); \
- in_section = bss; \
- } \
-} \
+}
/* This macro produces the initial definition of a function name.
On the RS/6000, we need to place an extra '.' in the function name and
"fr28", 60, "fr29", 61, "fr30", 62, "fr31", 63, \
/* no additional names for: mq, lr, ctr, ap */ \
"cr0", 68, "cr1", 69, "cr2", 70, "cr3", 71, \
- "cr4", 72, "cr5", 73, "cr6", 74, "cr7", 75 }
+ "cr4", 72, "cr5", 73, "cr6", 74, "cr7", 75, \
+ "cc", 68 }
/* How to renumber registers for dbx and gdb. */
to define a global common symbol. */
#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
- do { bss_section (); \
- fputs (".comm ", (FILE)); \
+ do { fputs (".comm ", (FILE)); \
RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \
fprintf ((FILE), ",%d\n", (SIZE)); } while (0)
to define a local common symbol. */
#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE,ROUNDED) \
- do { bss_section (); \
- fputs (".lcomm ", (FILE)); \
+ do { fputs (".lcomm ", (FILE)); \
RS6000_OUTPUT_BASENAME ((FILE), (NAME)); \
fprintf ((FILE), ",%d,%s\n", (SIZE), xcoff_bss_section_name); \
} while (0)
case REG:
return 1;
case SUBREG:
+ /* If we can't tie these modes, make this expensive. The larger
+ the mode, the more expensive it is. */
+ if (! MODES_TIEABLE_P (GET_MODE (x), GET_MODE (SUBREG_REG (x))))
+ return COSTS_N_INSNS (2
+ + GET_MODE_SIZE (GET_MODE (x)) / UNITS_PER_WORD);
return 2;
#ifdef RTX_COSTS
RTX_COSTS (x, code);
val &= (1 << INTVAL (op1)) - 1;
/* If desired, propagate sign bit. */
if (code == SIGN_EXTRACT && (val & (1 << (INTVAL (op1) - 1))))
- val |= ~ (1 << INTVAL (op1));
+ val |= ~ ((1 << INTVAL (op1)) - 1);
}
/* Clear the bits that don't belong in our mode,
if (x != 0 && CONSTANT_P (x))
return x;
+ /* If X is a MEM, try to fold it outside the context of any insn to see if
+ it might be equivalent to a constant. That handles the case where it
+ is a constant-pool reference. Then try to look it up in the hash table
+ in case it is something whose value we have seen before. */
+
+ if (GET_CODE (x) == MEM)
+ {
+ struct table_elt *elt;
+
+ x = fold_rtx (x, 0);
+ if (CONSTANT_P (x))
+ return x;
+
+ elt = lookup (x, safe_hash (x, GET_MODE (x)) % NBUCKETS, GET_MODE (x));
+ if (elt == 0)
+ return 0;
+
+ for (elt = elt->first_same_value; elt; elt = elt->next_same_value)
+ if (elt->is_const && CONSTANT_P (elt->exp))
+ return elt->exp;
+ }
+
return 0;
}
\f
|| sets[i].inner_dest != SET_DEST (sets[i].rtl));
}
- /* If we have (set (subreg:m1 (reg:m2 foo) 0) (bar:m1)), M1 is wider
- than M2, and both M1 and M2 are a single word, we are also doing
- (set (reg:m2 foo) (subreg:m2 (bar:m1 0))) so make that equivalence
- as well.
+ /* If we have (set (subreg:m1 (reg:m2 foo) 0) (bar:m1)), M1 is no
+ narrower than M2, and both M1 and M2 are the same number of words,
+ we are also doing (set (reg:m2 foo) (subreg:m2 (bar:m1) 0)) so
+ make that equivalence as well.
However, BAR may have equivalences for which gen_lowpart_if_possible
will produce a simpler value than gen_lowpart_if_possible applied to
already entered SRC and DEST of the SET in the table. */
if (GET_CODE (dest) == SUBREG
- && GET_MODE_SIZE (GET_MODE (dest)) <= UNITS_PER_WORD
- && GET_MODE_SIZE (GET_MODE (SUBREG_REG (dest))) <= UNITS_PER_WORD
+ && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (dest))) / UNITS_PER_WORD
+ == GET_MODE_SIZE (GET_MODE (dest)) / UNITS_PER_WORD)
&& (GET_MODE_SIZE (GET_MODE (dest))
>= GET_MODE_SIZE (GET_MODE (SUBREG_REG (dest))))
&& sets[i].src_elt != 0)
rtx p = insn, q;
int nsets = 0;
int low_cuid = INSN_CUID (insn), high_cuid = INSN_CUID (insn);
+ rtx next = GET_RTX_CLASS (GET_CODE (insn)) == 'i' ? insn : next_real_insn (insn);
int path_size = data->path_size;
int path_entry = 0;
int i;
{
/* Don't allow ourself to keep walking around an
always-executed loop. */
- if (next_real_insn (q) == next_real_insn (insn))
- break;
+ if (next_real_insn (q) == next)
+ {
+ p = NEXT_INSN (p);
+ continue;
+ }
/* Similarly, don't put a branch in our path more than once. */
for (i = 0; i < path_entry; i++)
{
register rtx tmp;
- if (next_real_insn (q) == next_real_insn (insn))
- break;
+ if (next_real_insn (q) == next)
+ {
+ p = NEXT_INSN (p);
+ continue;
+ }
for (i = 0; i < path_entry; i++)
if (data->path[i].branch == p)
*
* code generation `options':
*
- * - OBJC_INT_SELECTORS, OBJC_NONUNIQUE_SELECTORS, NEXT_OBJC_RUNTIME
+ * - OBJC_INT_SELECTORS, OBJC_SELECTORS_WITHOUT_LABELS, NEXT_OBJC_RUNTIME
*/
#include <stdio.h>
static tree _OBJC_INSTANCE_VARIABLES_decl, _OBJC_CLASS_VARIABLES_decl;
static tree _OBJC_INSTANCE_METHODS_decl, _OBJC_CLASS_METHODS_decl;
static tree _OBJC_CLASS_decl, _OBJC_METACLASS_decl;
-#ifdef OBJC_NONUNIQUE_SELECTORS
+#ifdef OBJC_SELECTORS_WITHOUT_LABELS
static tree _OBJC_SELECTOR_REFERENCES_decl;
#endif
static tree _OBJC_MODULES_decl;
/* extern SEL _OBJC_SELECTOR_REFERENCES[]; */
-#ifdef OBJC_NONUNIQUE_SELECTORS
+#ifdef OBJC_SELECTORS_WITHOUT_LABELS
_OBJC_SELECTOR_REFERENCES_decl
= create_builtin_decl (VAR_DECL, build_array_type (selector_type, NULLT),
"_OBJC_SELECTOR_REFERENCES");
/* refs = { ..., _OBJC_SELECTOR_REFERENCES, ... } */
-#ifndef OBJC_NONUNIQUE_SELECTORS
+#ifndef OBJC_SELECTORS_WITHOUT_LABELS
initlist = tree_cons (NULLT, build_int_2 (0, 0), initlist);
#else
if (sel_ref_chain)
return expr;
}
-#ifndef OBJC_NONUNIQUE_SELECTORS
+#ifndef OBJC_SELECTORS_WITHOUT_LABELS
static tree
build_selector_reference (idx)
int idx;
tree sc_spec, decl_specs, expr_decl;
tree chain, initlist = NULLT;
int offset = 0;
-#ifndef OBJC_NONUNIQUE_SELECTORS
+#ifndef OBJC_SELECTORS_WITHOUT_LABELS
tree decl, var_decl;
int idx = 0;
char buf[256];
{
tree expr;
-#ifndef OBJC_NONUNIQUE_SELECTORS
+#ifndef OBJC_SELECTORS_WITHOUT_LABELS
sprintf (buf, "_OBJC_SELECTOR_REFERENCES_%d", idx);
sc_spec = build_tree_list (NULLT, ridpointers[(int) RID_STATIC]);
/* add one for the '\0' character */
offset += IDENTIFIER_LENGTH (TREE_VALUE (chain)) + 1;
-#ifndef OBJC_NONUNIQUE_SELECTORS
+#ifndef OBJC_SELECTORS_WITHOUT_LABELS
finish_decl (decl, expr, NULLT);
idx++;
#else
#endif
}
-#ifdef OBJC_NONUNIQUE_SELECTORS
+#ifdef OBJC_SELECTORS_WITHOUT_LABELS
DECL_INITIAL (_OBJC_SELECTOR_REFERENCES_decl) = (tree) 1;
initlist = build_nt (CONSTRUCTOR, NULLT, nreverse (initlist));
finish_decl (_OBJC_SELECTOR_REFERENCES_decl, initlist, NULLT);
/* Build the parameters list for looking up the method.
These are the object itself and the selector. */
-#ifndef OBJC_NONUNIQUE_SELECTORS
+#ifndef OBJC_SELECTORS_WITHOUT_LABELS
selector = build_selector_reference (selTransTbl_index);
#else
selector = build_array_ref (_OBJC_SELECTOR_REFERENCES_decl,
selTransTbl_index = add_selector_reference (selname);
-#ifndef OBJC_NONUNIQUE_SELECTORS
+#ifndef OBJC_SELECTORS_WITHOUT_LABELS
return build_selector_reference (selTransTbl_index);
#else
/* synthesize a reference into the selector translation table */