summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/gcc
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2012-11-28 20:46:17 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2012-11-28 20:46:17 +0000
commit93367b8dde9946d28fedefc9492e93aa2596bdd3 (patch)
tree2c0bd68f043301e2c48f82bb4672bd25cf06fc62 /gnu/usr.bin/gcc
parent4709b335f431c905ac6e38b2e5e25c906032aedd (diff)
merge conflicts
Diffstat (limited to 'gnu/usr.bin/gcc')
-rw-r--r--gnu/usr.bin/gcc/Makefile.bsd-wrapper4
-rw-r--r--gnu/usr.bin/gcc/gcc/combine.c84
-rw-r--r--gnu/usr.bin/gcc/gcc/config/alpha/alpha.c26
-rw-r--r--gnu/usr.bin/gcc/gcc/config/alpha/alpha.h1
-rw-r--r--gnu/usr.bin/gcc/gcc/config/alpha/alpha.md113
-rw-r--r--gnu/usr.bin/gcc/gcc/config/i386/i386-protos.h2
-rw-r--r--gnu/usr.bin/gcc/gcc/config/i386/i386.c22
-rw-r--r--gnu/usr.bin/gcc/gcc/config/i386/i386.h2
-rw-r--r--gnu/usr.bin/gcc/gcc/config/mips/mips.c76
-rw-r--r--gnu/usr.bin/gcc/gcc/config/mips/mips.h25
-rw-r--r--gnu/usr.bin/gcc/gcc/config/mips/mips.md5
-rw-r--r--gnu/usr.bin/gcc/gcc/config/rs6000/rs6000.c18
-rw-r--r--gnu/usr.bin/gcc/gcc/config/sparc/sparc.c100
-rw-r--r--gnu/usr.bin/gcc/gcc/config/sparc/sparc.md1
-rwxr-xr-xgnu/usr.bin/gcc/gcc/configure10
-rw-r--r--gnu/usr.bin/gcc/gcc/cp/call.c27
-rw-r--r--gnu/usr.bin/gcc/gcc/doc/invoke.texi27
-rw-r--r--gnu/usr.bin/gcc/gcc/expr.c7
-rw-r--r--gnu/usr.bin/gcc/gcc/function.c70
-rw-r--r--gnu/usr.bin/gcc/gcc/reload1.c12
-rw-r--r--gnu/usr.bin/gcc/gcc/rtl.h2
-rw-r--r--gnu/usr.bin/gcc/gcc/unwind-dw2.c11
-rw-r--r--gnu/usr.bin/gcc/gcc/version.c2
23 files changed, 378 insertions, 269 deletions
diff --git a/gnu/usr.bin/gcc/Makefile.bsd-wrapper b/gnu/usr.bin/gcc/Makefile.bsd-wrapper
index 9a65242b070..dbf14e6c845 100644
--- a/gnu/usr.bin/gcc/Makefile.bsd-wrapper
+++ b/gnu/usr.bin/gcc/Makefile.bsd-wrapper
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.bsd-wrapper,v 1.61 2011/09/19 19:36:32 naddy Exp $
+# $OpenBSD: Makefile.bsd-wrapper,v 1.62 2012/11/28 20:46:15 miod Exp $
MAN= gcc.1 cpp.1 gcov.1 protoize.1
MLINKS+= protoize.1 unprotoize.1
@@ -11,7 +11,7 @@ LANGUAGES=--enable-languages=c
LANGUAGES=--enable-languages='c,c++,objc'
MLINKS+= gcc.1 g++.1 gcc.1 c++.1
.endif
-V=3.3.5
+V=3.3.6
.SUFFIXES: .1
.PATH.1: ${.CURDIR}/gcc ${.CURDIR}/gcc/doc
diff --git a/gnu/usr.bin/gcc/gcc/combine.c b/gnu/usr.bin/gcc/gcc/combine.c
index 2e58ffd0a6c..6c519f585bd 100644
--- a/gnu/usr.bin/gcc/gcc/combine.c
+++ b/gnu/usr.bin/gcc/gcc/combine.c
@@ -10157,13 +10157,8 @@ gen_lowpart_for_combine (mode, x)
result = gen_lowpart_common (mode, x);
#ifdef CANNOT_CHANGE_MODE_CLASS
- if (result != 0
- && GET_CODE (result) == SUBREG
- && GET_CODE (SUBREG_REG (result)) == REG
- && REGNO (SUBREG_REG (result)) >= FIRST_PSEUDO_REGISTER)
- bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (result))
- * MAX_MACHINE_MODE
- + GET_MODE (result));
+ if (result != 0 && GET_CODE (result) == SUBREG)
+ record_subregs_of_mode (result);
#endif
if (result)
@@ -10837,34 +10832,61 @@ simplify_comparison (code, pop0, pop1)
break;
case SUBREG:
- /* Check for the case where we are comparing A - C1 with C2,
- both constants are smaller than 1/2 the maximum positive
- value in MODE, and the comparison is equality or unsigned.
- In that case, if A is either zero-extended to MODE or has
- sufficient sign bits so that the high-order bit in MODE
- is a copy of the sign in the inner mode, we can prove that it is
- safe to do the operation in the wider mode. This simplifies
- many range checks. */
+ /* Check for the case where we are comparing A - C1 with C2, that is
+
+ (subreg:MODE (plus (A) (-C1))) op (C2)
+
+ with C1 a constant, and try to lift the SUBREG, i.e. to do the
+ comparison in the wider mode. One of the following two conditions
+ must be true in order for this to be valid:
+
+ 1. The mode extension results in the same bit pattern being added
+ on both sides and the comparison is equality or unsigned. As
+ C2 has been truncated to fit in MODE, the pattern can only be
+ all 0s or all 1s.
+
+ 2. The mode extension results in the sign bit being copied on
+ each side.
+
+ The difficulty here is that we have predicates for A but not for
+ (A - C1) so we need to check that C1 is within proper bounds so
+ as to perturbate A as little as possible. */
if (mode_width <= HOST_BITS_PER_WIDE_INT
&& subreg_lowpart_p (op0)
+ && GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (op0))) > mode_width
&& GET_CODE (SUBREG_REG (op0)) == PLUS
- && GET_CODE (XEXP (SUBREG_REG (op0), 1)) == CONST_INT
- && INTVAL (XEXP (SUBREG_REG (op0), 1)) < 0
- && (-INTVAL (XEXP (SUBREG_REG (op0), 1))
- < (HOST_WIDE_INT) (GET_MODE_MASK (mode) / 2))
- && (unsigned HOST_WIDE_INT) const_op < GET_MODE_MASK (mode) / 2
- && (0 == (nonzero_bits (XEXP (SUBREG_REG (op0), 0),
- GET_MODE (SUBREG_REG (op0)))
- & ~GET_MODE_MASK (mode))
- || (num_sign_bit_copies (XEXP (SUBREG_REG (op0), 0),
- GET_MODE (SUBREG_REG (op0)))
- > (unsigned int)
- (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (op0)))
- - GET_MODE_BITSIZE (mode)))))
- {
- op0 = SUBREG_REG (op0);
- continue;
+ && GET_CODE (XEXP (SUBREG_REG (op0), 1)) == CONST_INT)
+ {
+ enum machine_mode inner_mode = GET_MODE (SUBREG_REG (op0));
+ rtx a = XEXP (SUBREG_REG (op0), 0);
+ HOST_WIDE_INT c1 = -INTVAL (XEXP (SUBREG_REG (op0), 1));
+
+ if ((c1 > 0
+ && (unsigned HOST_WIDE_INT) c1
+ < (unsigned HOST_WIDE_INT) 1 << (mode_width - 1)
+ && (equality_comparison_p || unsigned_comparison_p)
+ /* (A - C1) zero-extends if it is positive and sign-extends
+ if it is negative, C2 both zero- and sign-extends. */
+ && ((0 == (nonzero_bits (a, inner_mode)
+ & ~GET_MODE_MASK (mode))
+ && const_op >= 0)
+ /* (A - C1) sign-extends if it is positive and 1-extends
+ if it is negative, C2 both sign- and 1-extends. */
+ || (num_sign_bit_copies (a, inner_mode)
+ > (unsigned int) (GET_MODE_BITSIZE (inner_mode)
+ - mode_width)
+ && const_op < 0)))
+ || ((unsigned HOST_WIDE_INT) c1
+ < (unsigned HOST_WIDE_INT) 1 << (mode_width - 2)
+ /* (A - C1) always sign-extends, like C2. */
+ && num_sign_bit_copies (a, inner_mode)
+ > (unsigned int) (GET_MODE_BITSIZE (inner_mode)
+ - mode_width - 1)))
+ {
+ op0 = SUBREG_REG (op0);
+ continue;
+ }
}
/* If the inner mode is narrower and we are extracting the low part,
diff --git a/gnu/usr.bin/gcc/gcc/config/alpha/alpha.c b/gnu/usr.bin/gcc/gcc/config/alpha/alpha.c
index 1293b785e18..a71e02fc526 100644
--- a/gnu/usr.bin/gcc/gcc/config/alpha/alpha.c
+++ b/gnu/usr.bin/gcc/gcc/config/alpha/alpha.c
@@ -6779,11 +6779,6 @@ alpha_sa_mask (imaskP, fmaskP)
break;
imask |= 1L << regno;
}
-
- /* Glibc likes to use $31 as an unwind stopper for crt0. To
- avoid hackery in unwind-dw2.c, we need to actively store a
- zero in the prologue of _Unwind_RaiseException et al. */
- imask |= 1UL << 31;
}
/* If any register spilled, then spill the return address also. */
@@ -7292,24 +7287,6 @@ alpha_expand_prologue ()
reg_offset += 8;
}
- /* Store a zero if requested for unwinding. */
- if (imask & (1UL << 31))
- {
- rtx insn, t;
-
- mem = gen_rtx_MEM (DImode, plus_constant (sa_reg, reg_offset));
- set_mem_alias_set (mem, alpha_sr_alias_set);
- insn = emit_move_insn (mem, const0_rtx);
-
- RTX_FRAME_RELATED_P (insn) = 1;
- t = gen_rtx_REG (Pmode, 31);
- t = gen_rtx_SET (VOIDmode, mem, t);
- t = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, t, REG_NOTES (insn));
- REG_NOTES (insn) = t;
-
- reg_offset += 8;
- }
-
for (i = 0; i < 31; i++)
if (fmask & (1L << i))
{
@@ -7730,9 +7707,6 @@ alpha_expand_epilogue ()
reg_offset += 8;
}
- if (imask & (1UL << 31))
- reg_offset += 8;
-
for (i = 0; i < 31; ++i)
if (fmask & (1L << i))
{
diff --git a/gnu/usr.bin/gcc/gcc/config/alpha/alpha.h b/gnu/usr.bin/gcc/gcc/config/alpha/alpha.h
index 42e83d062b4..0b3211e4ee5 100644
--- a/gnu/usr.bin/gcc/gcc/config/alpha/alpha.h
+++ b/gnu/usr.bin/gcc/gcc/config/alpha/alpha.h
@@ -1301,6 +1301,7 @@ do { \
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, 26)
#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (26)
#define DWARF_ALT_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (64)
+#define DWARF_ZERO_REG 31
/* Describe how we implement __builtin_eh_return. */
#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 16 : INVALID_REGNUM)
diff --git a/gnu/usr.bin/gcc/gcc/config/alpha/alpha.md b/gnu/usr.bin/gcc/gcc/config/alpha/alpha.md
index 4664820f6a7..61f23e15be0 100644
--- a/gnu/usr.bin/gcc/gcc/config/alpha/alpha.md
+++ b/gnu/usr.bin/gcc/gcc/config/alpha/alpha.md
@@ -80,6 +80,7 @@
(UNSPECV_PLDGP2 11) ; prologue ldgp
(UNSPECV_SET_TP 12)
(UNSPECV_RPCC 13)
+ (UNSPECV_SETJMPR_ER 14) ; builtin_setjmp_receiver fragment
])
;; Where necessary, the suffixes _le and _be are used to distinguish between
@@ -6765,70 +6766,44 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
"jmp $31,(%0),0"
[(set_attr "type" "ibr")])
-(define_insn "*builtin_setjmp_receiver_er_sl_1"
- [(unspec_volatile [(label_ref (match_operand 0 "" ""))] UNSPECV_SETJMPR)]
- "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF && TARGET_AS_CAN_SUBTRACT_LABELS"
- "lda $27,$LSJ%=-%l0($27)\n$LSJ%=:")
-
-(define_insn "*builtin_setjmp_receiver_er_1"
- [(unspec_volatile [(label_ref (match_operand 0 "" ""))] UNSPECV_SETJMPR)]
- "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
- "br $27,$LSJ%=\n$LSJ%=:"
- [(set_attr "type" "ibr")])
-
-(define_split
- [(unspec_volatile [(label_ref (match_operand 0 "" ""))] UNSPECV_SETJMPR)]
- "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF
- && prev_nonnote_insn (insn) == operands[0]"
- [(const_int 0)]
- "
-{
- emit_note (NULL, NOTE_INSN_DELETED);
- DONE;
-}")
-
-(define_insn "*builtin_setjmp_receiver_1"
+(define_expand "builtin_setjmp_receiver"
[(unspec_volatile [(label_ref (match_operand 0 "" ""))] UNSPECV_SETJMPR)]
"TARGET_ABI_OSF"
- "br $27,$LSJ%=\n$LSJ%=:\;ldgp $29,0($27)"
- [(set_attr "length" "12")
- (set_attr "type" "multi")])
+ "")
-(define_expand "builtin_setjmp_receiver_er"
- [(unspec_volatile [(label_ref (match_operand 0 "" ""))] UNSPECV_SETJMPR)
+(define_insn_and_split "*builtin_setjmp_receiver_1"
+ [(unspec_volatile [(match_operand 0 "" "")] UNSPECV_SETJMPR)]
+ "TARGET_ABI_OSF"
+{
+ if (TARGET_EXPLICIT_RELOCS)
+ return "#";
+ else
+ return "br $27,$LSJ%=\n$LSJ%=:\;ldgp $29,0($27)";
+}
+ "&& TARGET_EXPLICIT_RELOCS && reload_completed"
+ [(unspec_volatile [(match_dup 0)] UNSPECV_SETJMPR_ER)
(set (match_dup 1)
(unspec_volatile:DI [(match_dup 2) (match_dup 3)] UNSPECV_LDGP1))
(set (match_dup 1)
(unspec:DI [(match_dup 1) (match_dup 3)] UNSPEC_LDGP2))]
- ""
{
operands[1] = pic_offset_table_rtx;
operands[2] = gen_rtx_REG (Pmode, 27);
operands[3] = GEN_INT (alpha_next_sequence_number++);
-})
+}
+ [(set_attr "length" "12")
+ (set_attr "type" "multi")])
-(define_expand "builtin_setjmp_receiver"
- [(unspec_volatile [(label_ref (match_operand 0 "" ""))] UNSPECV_SETJMPR)]
- "TARGET_ABI_OSF"
-{
- if (TARGET_EXPLICIT_RELOCS)
- {
- emit_insn (gen_builtin_setjmp_receiver_er (operands[0]));
- DONE;
- }
-})
+(define_insn "*builtin_setjmp_receiver_er_sl_1"
+ [(unspec_volatile [(match_operand 0 "" "")] UNSPECV_SETJMPR_ER)]
+ "TARGET_ABI_OSF && TARGET_EXPLICIT_RELOCS && TARGET_AS_CAN_SUBTRACT_LABELS"
+ "lda $27,$LSJ%=-%l0($27)\n$LSJ%=:")
-(define_expand "exception_receiver_er"
- [(set (match_dup 0)
- (unspec_volatile:DI [(match_dup 1) (match_dup 2)] UNSPECV_LDGP1))
- (set (match_dup 0)
- (unspec:DI [(match_dup 0) (match_dup 2)] UNSPEC_LDGP2))]
- ""
-{
- operands[0] = pic_offset_table_rtx;
- operands[1] = gen_rtx_REG (Pmode, 26);
- operands[2] = GEN_INT (alpha_next_sequence_number++);
-})
+(define_insn "*builtin_setjmp_receiver_er_1"
+ [(unspec_volatile [(match_operand 0 "" "")] UNSPECV_SETJMPR_ER)]
+ "TARGET_ABI_OSF && TARGET_EXPLICIT_RELOCS"
+ "br $27,$LSJ%=\n$LSJ%=:"
+ [(set_attr "type" "ibr")])
(define_expand "exception_receiver"
[(unspec_volatile [(match_dup 0)] UNSPECV_EHR)]
@@ -6836,28 +6811,38 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
{
if (TARGET_LD_BUGGY_LDGP)
operands[0] = alpha_gp_save_rtx ();
- else if (TARGET_EXPLICIT_RELOCS)
- {
- emit_insn (gen_exception_receiver_er ());
- DONE;
- }
else
operands[0] = const0_rtx;
})
-(define_insn "*exception_receiver_1"
- [(unspec_volatile [(const_int 0)] UNSPECV_EHR)]
- "! TARGET_LD_BUGGY_LDGP"
- "ldgp $29,0($26)"
- [(set_attr "length" "8")
- (set_attr "type" "multi")])
-
(define_insn "*exception_receiver_2"
[(unspec_volatile [(match_operand:DI 0 "memory_operand" "m")] UNSPECV_EHR)]
- "TARGET_LD_BUGGY_LDGP"
+ "TARGET_ABI_OSF && TARGET_LD_BUGGY_LDGP"
"ldq $29,%0"
[(set_attr "type" "ild")])
+(define_insn_and_split "*exception_receiver_1"
+ [(unspec_volatile [(const_int 0)] UNSPECV_EHR)]
+ "TARGET_ABI_OSF"
+{
+ if (TARGET_EXPLICIT_RELOCS)
+ return "ldah $29,0($26)\t\t!gpdisp!%*\;lda $29,0($29)\t\t!gpdisp!%*";
+ else
+ return "ldgp $29,0($26)";
+}
+ "&& TARGET_EXPLICIT_RELOCS && reload_completed"
+ [(set (match_dup 0)
+ (unspec_volatile:DI [(match_dup 1) (match_dup 2)] UNSPECV_LDGP1))
+ (set (match_dup 0)
+ (unspec:DI [(match_dup 0) (match_dup 2)] UNSPEC_LDGP2))]
+{
+ operands[0] = pic_offset_table_rtx;
+ operands[1] = gen_rtx_REG (Pmode, 26);
+ operands[2] = GEN_INT (alpha_next_sequence_number++);
+}
+ [(set_attr "length" "8")
+ (set_attr "type" "multi")])
+
(define_expand "nonlocal_goto_receiver"
[(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)
(set (reg:DI 27) (mem:DI (reg:DI 29)))
diff --git a/gnu/usr.bin/gcc/gcc/config/i386/i386-protos.h b/gnu/usr.bin/gcc/gcc/config/i386/i386-protos.h
index 1c1d650a8cc..7d1581f6175 100644
--- a/gnu/usr.bin/gcc/gcc/config/i386/i386-protos.h
+++ b/gnu/usr.bin/gcc/gcc/config/i386/i386-protos.h
@@ -88,6 +88,8 @@ extern int memory_displacement_operand PARAMS ((rtx, enum machine_mode));
extern int cmpsi_operand PARAMS ((rtx, enum machine_mode));
extern int long_memory_operand PARAMS ((rtx, enum machine_mode));
extern int aligned_operand PARAMS ((rtx, enum machine_mode));
+extern int compare_operator PARAMS ((rtx, enum machine_mode));
+extern int flags_reg_operand PARAMS ((rtx, enum machine_mode));
extern enum machine_mode ix86_cc_mode PARAMS ((enum rtx_code, rtx, rtx));
extern int ix86_expand_movstr PARAMS ((rtx, rtx, rtx, rtx));
diff --git a/gnu/usr.bin/gcc/gcc/config/i386/i386.c b/gnu/usr.bin/gcc/gcc/config/i386/i386.c
index 62718ba7c26..6a839ac0acc 100644
--- a/gnu/usr.bin/gcc/gcc/config/i386/i386.c
+++ b/gnu/usr.bin/gcc/gcc/config/i386/i386.c
@@ -3615,6 +3615,20 @@ q_regs_operand (op, mode)
return ANY_QI_REG_P (op);
}
+/* Return true if op is an flags register. */
+
+int
+flags_reg_operand (op, mode)
+ register rtx op;
+ enum machine_mode mode;
+{
+ if (mode != VOIDmode && GET_MODE (op) != mode)
+ return 0;
+ return (GET_CODE (op) == REG
+ && REGNO (op) == FLAGS_REG
+ && GET_MODE (op) != VOIDmode);
+}
+
/* Return true if op is a NON_Q_REGS class register. */
int
@@ -3975,6 +3989,14 @@ aligned_operand (op, mode)
/* Didn't find one -- this must be an aligned address. */
return 1;
}
+
+int
+compare_operator (op, mode)
+ rtx op;
+ enum machine_mode mode ATTRIBUTE_UNUSED;
+{
+ return GET_CODE (op) == COMPARE;
+}
/* Return true if the constant is something that can be loaded with
a special instruction. Only handle 0.0 and 1.0; others are less
diff --git a/gnu/usr.bin/gcc/gcc/config/i386/i386.h b/gnu/usr.bin/gcc/gcc/config/i386/i386.h
index f8d521df5fd..8dc6b412017 100644
--- a/gnu/usr.bin/gcc/gcc/config/i386/i386.h
+++ b/gnu/usr.bin/gcc/gcc/config/i386/i386.h
@@ -3308,6 +3308,7 @@ do { \
SYMBOL_REF, LABEL_REF, SUBREG, REG, MEM}}, \
{"nonmemory_no_elim_operand", {CONST_INT, REG, SUBREG}}, \
{"index_register_operand", {SUBREG, REG}}, \
+ {"flags_reg_operand", {REG}}, \
{"q_regs_operand", {SUBREG, REG}}, \
{"non_q_regs_operand", {SUBREG, REG}}, \
{"fcmov_comparison_operator", {EQ, NE, LTU, GTU, LEU, GEU, UNORDERED, \
@@ -3343,6 +3344,7 @@ do { \
{"fp_register_operand", {REG}}, \
{"register_and_not_fp_reg_operand", {REG}}, \
{"vector_move_operand", {CONST_VECTOR, SUBREG, REG, MEM}}, \
+ {"compare_operator", {COMPARE}},
/* A list of predicates that do special things with modes, and so
should not elicit warnings for VOIDmode match_operand. */
diff --git a/gnu/usr.bin/gcc/gcc/config/mips/mips.c b/gnu/usr.bin/gcc/gcc/config/mips/mips.c
index 3ea546f7e51..d6d03613a05 100644
--- a/gnu/usr.bin/gcc/gcc/config/mips/mips.c
+++ b/gnu/usr.bin/gcc/gcc/config/mips/mips.c
@@ -1,6 +1,6 @@
/* Subroutines for insn-output.c for MIPS
Copyright (C) 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
Contributed by A. Lichnewsky, lich@inria.inria.fr.
Changes by Michael Meissner, meissner@osf.org.
64 bit r4000 support by Ian Lance Taylor, ian@cygnus.com, and
@@ -6562,26 +6562,84 @@ copy_file_data (to, from)
fatal_io_error ("can't close temp file");
}
-/* Emit either a label, .comm, or .lcomm directive, and mark that the symbol
- is used, so that we don't emit an .extern for it in mips_asm_file_end. */
+/* Implement ASM_OUTPUT_ALIGNED_DECL_COMMON. This is usually the same as
+ the elfos.h version, but we also need to handle -muninit-const-in-rodata
+ and the limitations of the SGI o32 assembler. */
void
-mips_declare_object (stream, name, init_string, final_string, size)
+mips_output_aligned_decl_common (stream, decl, name, size, align)
FILE *stream;
+ tree decl;
const char *name;
- const char *init_string;
- const char *final_string;
- int size;
+ unsigned HOST_WIDE_INT size;
+ unsigned int align;
{
- fputs (init_string, stream); /* "", "\t.comm\t", or "\t.lcomm\t" */
+ const char *format;
+
+ /* If the target wants uninitialized const declarations in
+ .rdata then don't put them in .comm. */
+ if (TARGET_EMBEDDED_DATA && TARGET_UNINIT_CONST_IN_RODATA
+ && TREE_CODE (decl) == VAR_DECL && TREE_READONLY (decl)
+ && (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node))
+ {
+ if (TREE_PUBLIC (decl) && DECL_NAME (decl))
+ targetm.asm_out.globalize_label (stream, name);
+
+ readonly_data_section ();
+ ASM_OUTPUT_ALIGN (stream, floor_log2 (align / BITS_PER_UNIT));
+
+ format = ACONCAT ((":\n\t.space\t", HOST_WIDE_INT_PRINT_UNSIGNED,
+ "\n", NULL));
+ mips_declare_object (stream, name, "", format, size);
+ }
+#ifdef TARGET_IRIX6
+ /* The SGI o32 assembler doesn't accept an alignment, so round up
+ the size instead. */
+ else if (mips_abi == ABI_32 && !TARGET_GAS)
+ {
+ size += (align / BITS_PER_UNIT) - 1;
+ size -= size % (align / BITS_PER_UNIT);
+ format = ACONCAT ((",", HOST_WIDE_INT_PRINT_UNSIGNED, "\n", NULL));
+ mips_declare_object (stream, name, "\n\t.comm\t", format, size);
+ }
+#endif
+ else
+ {
+ format = ACONCAT ((",", HOST_WIDE_INT_PRINT_UNSIGNED, ",%u\n", NULL));
+ mips_declare_object (stream, name, "\n\t.comm\t", format,
+ size, align / BITS_PER_UNIT);
+ }
+}
+
+/* Emit either a label, .comm, or .lcomm directive. When using assembler
+ macros, mark the symbol as written so that mips_file_end won't emit an
+ .extern for it. STREAM is the output file, NAME is the name of the
+ symbol, INIT_STRING is the string that should be written before the
+ symbol and FINAL_STRING is the string that shoulbe written after it.
+ FINAL_STRING is a printf() format that consumes the remaining arguments. */
+
+void
+mips_declare_object VPARAMS ((FILE *stream, const char *name,
+ const char *init_string,
+ const char *final_string, ...))
+{
+ VA_OPEN (ap, final_string);
+ VA_FIXEDARG (ap, FILE *, stream);
+ VA_FIXEDARG (ap, const char *, name);
+ VA_FIXEDARG (ap, const char *, init_string);
+ VA_FIXEDARG (ap, const char *, final_string);
+
+ fputs (init_string, stream);
assemble_name (stream, name);
- fprintf (stream, final_string, size); /* ":\n", ",%u\n", ",%u\n" */
+ vfprintf (stream, final_string, ap);
if (TARGET_GP_OPT)
{
tree name_tree = get_identifier (name);
TREE_ASM_WRITTEN (name_tree) = 1;
}
+
+ VA_CLOSE (ap);
}
/* Return the bytes needed to compute the frame pointer from the current
diff --git a/gnu/usr.bin/gcc/gcc/config/mips/mips.h b/gnu/usr.bin/gcc/gcc/config/mips/mips.h
index 07d2fe2b546..d63bb2aab69 100644
--- a/gnu/usr.bin/gcc/gcc/config/mips/mips.h
+++ b/gnu/usr.bin/gcc/gcc/config/mips/mips.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler. MIPS version.
Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
- 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
Contributed by A. Lichnewsky (lich@inria.inria.fr).
Changed by Michael Meissner (meissner@osf.org).
64 bit r4000 support by Ian Lance Taylor (ian@cygnus.com) and
@@ -4327,28 +4327,7 @@ while (0)
/* This says how to define a global common symbol. */
-#define ASM_OUTPUT_ALIGNED_DECL_COMMON(STREAM, DECL, NAME, SIZE, ALIGN) \
- do { \
- /* If the target wants uninitialized const declarations in \
- .rdata then don't put them in .comm */ \
- if (TARGET_EMBEDDED_DATA && TARGET_UNINIT_CONST_IN_RODATA \
- && TREE_CODE (DECL) == VAR_DECL && TREE_READONLY (DECL) \
- && (DECL_INITIAL (DECL) == 0 \
- || DECL_INITIAL (DECL) == error_mark_node)) \
- { \
- if (TREE_PUBLIC (DECL) && DECL_NAME (DECL)) \
- (*targetm.asm_out.globalize_label) (STREAM, NAME); \
- \
- readonly_data_section (); \
- ASM_OUTPUT_ALIGN (STREAM, floor_log2 (ALIGN / BITS_PER_UNIT)); \
- mips_declare_object (STREAM, NAME, "", ":\n\t.space\t%u\n", \
- (SIZE)); \
- } \
- else \
- mips_declare_object (STREAM, NAME, "\n\t.comm\t", ",%u\n", \
- (SIZE)); \
- } while (0)
-
+#define ASM_OUTPUT_ALIGNED_DECL_COMMON mips_output_aligned_decl_common
/* This says how to define a local common symbol (ie, not visible to
linker). */
diff --git a/gnu/usr.bin/gcc/gcc/config/mips/mips.md b/gnu/usr.bin/gcc/gcc/config/mips/mips.md
index 4b8529185e6..4daeae6e7b1 100644
--- a/gnu/usr.bin/gcc/gcc/config/mips/mips.md
+++ b/gnu/usr.bin/gcc/gcc/config/mips/mips.md
@@ -1,6 +1,6 @@
;; Mips.md Machine Description for MIPS based processors
;; Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-;; 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+;; 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
;; Contributed by A. Lichnewsky, lich@inria.inria.fr
;; Changes by Michael Meissner, meissner@osf.org
;; 64 bit r4000 support by Ian Lance Taylor, ian@cygnus.com, and
@@ -163,8 +163,7 @@
;; Describe a user's asm statement.
(define_asm_attributes
- [(set_attr "type" "multi")
- (set_attr "can_delay" "no")])
+ [(set_attr "type" "multi")])
;; whether or not generating calls to position independent functions
(define_attr "abicalls" "no,yes"
diff --git a/gnu/usr.bin/gcc/gcc/config/rs6000/rs6000.c b/gnu/usr.bin/gcc/gcc/config/rs6000/rs6000.c
index 991b81e1848..f4ab73b2fa8 100644
--- a/gnu/usr.bin/gcc/gcc/config/rs6000/rs6000.c
+++ b/gnu/usr.bin/gcc/gcc/config/rs6000/rs6000.c
@@ -150,7 +150,8 @@ static int rs6000_sr_alias_set;
/* Call distance, overridden by -mlongcall and #pragma longcall(1).
The only place that looks at this is rs6000_set_default_type_attributes;
everywhere else should rely on the presence or absence of a longcall
- attribute on the function declaration. */
+ attribute on the function declaration. Exception: init_cumulative_args
+ looks at it too, for libcalls. */
int rs6000_default_long_calls;
const char *rs6000_longcall_switch;
@@ -2910,10 +2911,11 @@ init_cumulative_args (cum, fntype, libname, incoming, libcall)
cum->orig_nargs = cum->nargs_prototype;
/* Check for a longcall attribute. */
- if (fntype
- && lookup_attribute ("longcall", TYPE_ATTRIBUTES (fntype))
- && !lookup_attribute ("shortcall", TYPE_ATTRIBUTES (fntype)))
- cum->call_cookie = CALL_LONG;
+ if ((!fntype && rs6000_default_long_calls)
+ || (fntype
+ && lookup_attribute ("longcall", TYPE_ATTRIBUTES (fntype))
+ && !lookup_attribute ("shortcall", TYPE_ATTRIBUTES (fntype))))
+ cum->call_cookie |= CALL_LONG;
if (TARGET_DEBUG_ARG)
{
@@ -10359,8 +10361,10 @@ rs6000_emit_prologue ()
rtx reg, mem, vrsave;
int offset;
- /* Get VRSAVE onto a GPR. */
- reg = gen_rtx_REG (SImode, 12);
+ /* Get VRSAVE onto a GPR. Note that ABI_V4 might be using r12
+ as frame_reg_rtx and r11 as the static chain pointer for
+ nested functions. */
+ reg = gen_rtx_REG (SImode, 0);
vrsave = gen_rtx_REG (SImode, VRSAVE_REGNO);
if (TARGET_MACHO)
emit_insn (gen_get_vrsave_internal (reg));
diff --git a/gnu/usr.bin/gcc/gcc/config/sparc/sparc.c b/gnu/usr.bin/gcc/gcc/config/sparc/sparc.c
index 4216416529a..f0c9c067a20 100644
--- a/gnu/usr.bin/gcc/gcc/config/sparc/sparc.c
+++ b/gnu/usr.bin/gcc/gcc/config/sparc/sparc.c
@@ -178,6 +178,8 @@ static void emit_hard_tfmode_operation PARAMS ((enum rtx_code, rtx *));
static void sparc_encode_section_info PARAMS ((tree, int));
static void sparc_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
HOST_WIDE_INT, tree));
+static bool sparc_can_output_mi_thunk PARAMS ((tree, HOST_WIDE_INT,
+ HOST_WIDE_INT, tree));
/* Option handling. */
@@ -244,7 +246,7 @@ enum processor_type sparc_cpu;
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK sparc_output_mi_thunk
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
-#define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall
+#define TARGET_ASM_CAN_OUTPUT_MI_THUNK sparc_can_output_mi_thunk
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -8666,18 +8668,21 @@ sparc_encode_section_info (decl, first)
SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)) = 1;
}
-/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
- Used for C++ multiple inheritance. */
+/* Output the assembler code for a thunk function. THUNK_DECL is the
+ declaration for the thunk function itself, FUNCTION is the decl for
+ the target function. DELTA is an immediate constant offset to be
+ added to THIS. If VCALL_OFFSET is nonzero, the word at address
+ (*THIS + VCALL_OFFSET) should be additionally added to THIS. */
static void
sparc_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
FILE *file;
tree thunk_fndecl ATTRIBUTE_UNUSED;
HOST_WIDE_INT delta;
- HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED;
+ HOST_WIDE_INT vcall_offset;
tree function;
{
- rtx this, insn, funexp, delta_rtx, tmp;
+ rtx this, insn, funexp;
reload_completed = 1;
no_new_pseudos = 1;
@@ -8694,26 +8699,73 @@ sparc_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
/* Add DELTA. When possible use a plain add, otherwise load it into
a register first. */
- delta_rtx = GEN_INT (delta);
- if (!SPARC_SIMM13_P (delta))
+ if (delta)
{
+ rtx delta_rtx = GEN_INT (delta);
+
+ if (! SPARC_SIMM13_P (delta))
+ {
+ rtx scratch = gen_rtx_REG (Pmode, 1);
+ emit_move_insn (scratch, delta_rtx);
+ delta_rtx = scratch;
+ }
+
+ /* THIS += DELTA. */
+ emit_insn (gen_add2_insn (this, delta_rtx));
+ }
+
+ /* Add the word at address (*THIS + VCALL_OFFSET). */
+ if (vcall_offset)
+ {
+ rtx vcall_offset_rtx = GEN_INT (vcall_offset);
rtx scratch = gen_rtx_REG (Pmode, 1);
- if (input_operand (delta_rtx, GET_MODE (scratch)))
- emit_insn (gen_rtx_SET (VOIDmode, scratch, delta_rtx));
+ if (vcall_offset >= 0)
+ abort ();
+
+ /* SCRATCH = *THIS. */
+ emit_move_insn (scratch, gen_rtx_MEM (Pmode, this));
+
+ /* Prepare for adding VCALL_OFFSET. The difficulty is that we
+ may not have any available scratch register at this point. */
+ if (SPARC_SIMM13_P (vcall_offset))
+ ;
+ /* This is the case if ARCH64 (unless -ffixed-g5 is passed). */
+ else if (! fixed_regs[5]
+ /* The below sequence is made up of at least 2 insns,
+ while the default method may need only one. */
+ && vcall_offset < -8192)
+ {
+ rtx scratch2 = gen_rtx_REG (Pmode, 5);
+ emit_move_insn (scratch2, vcall_offset_rtx);
+ vcall_offset_rtx = scratch2;
+ }
else
{
- if (TARGET_ARCH64)
- sparc_emit_set_const64 (scratch, delta_rtx);
- else
- sparc_emit_set_const32 (scratch, delta_rtx);
+ rtx increment = GEN_INT (-4096);
+
+ /* VCALL_OFFSET is a negative number whose typical range can be
+ estimated as -32768..0 in 32-bit mode. In almost all cases
+ it is therefore cheaper to emit multiple add insns than
+ spilling and loading the constant into a register (at least
+ 6 insns). */
+ while (! SPARC_SIMM13_P (vcall_offset))
+ {
+ emit_insn (gen_add2_insn (scratch, increment));
+ vcall_offset += 4096;
+ }
+ vcall_offset_rtx = GEN_INT (vcall_offset); /* cannot be 0 */
}
- delta_rtx = scratch;
- }
+ /* SCRATCH = *(*THIS + VCALL_OFFSET). */
+ emit_move_insn (scratch, gen_rtx_MEM (Pmode,
+ gen_rtx_PLUS (Pmode,
+ scratch,
+ vcall_offset_rtx)));
- tmp = gen_rtx_PLUS (Pmode, this, delta_rtx);
- emit_insn (gen_rtx_SET (VOIDmode, this, tmp));
+ /* THIS += *(*THIS + VCALL_OFFSET). */
+ emit_insn (gen_add2_insn (this, scratch));
+ }
/* Generate a tail call to the target function. */
if (! TREE_USED (function))
@@ -8741,4 +8793,18 @@ sparc_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
no_new_pseudos = 0;
}
+/* Return true if sparc_output_mi_thunk would be able to output the
+ assembler code for the thunk function specified by the arguments
+ it is passed, and false otherwise. */
+static bool
+sparc_can_output_mi_thunk (thunk_fndecl, delta, vcall_offset, function)
+ tree thunk_fndecl ATTRIBUTE_UNUSED;
+ HOST_WIDE_INT delta ATTRIBUTE_UNUSED;
+ HOST_WIDE_INT vcall_offset;
+ tree function ATTRIBUTE_UNUSED;
+{
+ /* Bound the loop used in the default method above. */
+ return (vcall_offset >= -32768 || ! fixed_regs[5]);
+}
+
#include "gt-sparc.h"
diff --git a/gnu/usr.bin/gcc/gcc/config/sparc/sparc.md b/gnu/usr.bin/gcc/gcc/config/sparc/sparc.md
index 2d149a3f3a8..e9dc9ca5b9d 100644
--- a/gnu/usr.bin/gcc/gcc/config/sparc/sparc.md
+++ b/gnu/usr.bin/gcc/gcc/config/sparc/sparc.md
@@ -2048,7 +2048,6 @@
if (! CONSTANT_P (operands[1]) || input_operand (operands[1], DImode))
;
else if (TARGET_ARCH64
- && CONSTANT_P (operands[1])
&& GET_CODE (operands[1]) != HIGH
&& GET_CODE (operands[1]) != LO_SUM)
{
diff --git a/gnu/usr.bin/gcc/gcc/configure b/gnu/usr.bin/gcc/gcc/configure
index 1eff0613db0..dfe788e4b96 100755
--- a/gnu/usr.bin/gcc/gcc/configure
+++ b/gnu/usr.bin/gcc/gcc/configure
@@ -2399,7 +2399,7 @@ EOF
fi
# Find some useful tools
-for ac_prog in gawk mawk nawk awk
+for ac_prog in mawk gawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@@ -3947,7 +3947,7 @@ else
# read() to the same fd. The only system known to have a problem here
# is VMS, where text files have record structure.
case "$host_os" in
- vms*)
+ vms* | ultrix*)
gcc_cv_func_mmap_file=no ;;
*)
gcc_cv_func_mmap_file=yes;;
@@ -8120,7 +8120,7 @@ fi
echo "$ac_t""$gcc_cv_ld_eh_frame_hdr" 1>&6
echo $ac_n "checking linker --as-needed support""... $ac_c" 1>&6
-echo "configure:8250: checking linker --as-needed support" >&5
+echo "configure:8124: checking linker --as-needed support" >&5
gcc_cv_ld_as_needed=no
if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
@@ -8144,7 +8144,7 @@ echo "$ac_t""$gcc_cv_ld_as_needed" 1>&6
case "$target" in
mips*-*-*)
echo $ac_n "checking whether libgloss uses STARTUP directives consistently""... $ac_c" 1>&6
-echo "configure:8127: checking whether libgloss uses STARTUP directives consistently" >&5
+echo "configure:8148: checking whether libgloss uses STARTUP directives consistently" >&5
gcc_cv_mips_libgloss_startup=no
gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss
if test "x$exec_prefix" = xNONE; then
@@ -8349,7 +8349,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:8332: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:8353: checking whether to enable maintainer-specific portions of Makefiles" >&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
diff --git a/gnu/usr.bin/gcc/gcc/cp/call.c b/gnu/usr.bin/gcc/gcc/cp/call.c
index 0617380ced5..e12eac2d1ff 100644
--- a/gnu/usr.bin/gcc/gcc/cp/call.c
+++ b/gnu/usr.bin/gcc/gcc/cp/call.c
@@ -3762,28 +3762,11 @@ build_new_op (code, flags, arg1, arg2, arg3)
}
if (TREE_CODE (cand->fn) == FUNCTION_DECL)
- {
- extern int warn_synth;
- if (warn_synth
- && fnname == ansi_assopname (NOP_EXPR)
- && DECL_ARTIFICIAL (cand->fn)
- && candidates->next
- && ! candidates->next->next)
- {
- warning ("using synthesized `%#D' for copy assignment",
- cand->fn);
- cp_warning_at (" where cfront would use `%#D'",
- cand == candidates
- ? candidates->next->fn
- : candidates->fn);
- }
-
- return build_over_call
- (cand,
- TREE_CODE (TREE_TYPE (cand->fn)) == METHOD_TYPE
- ? mem_arglist : arglist,
- LOOKUP_NORMAL);
- }
+ return build_over_call
+ (cand,
+ TREE_CODE (TREE_TYPE (cand->fn)) == METHOD_TYPE
+ ? mem_arglist : arglist,
+ LOOKUP_NORMAL);
/* Check for comparison of different enum types. */
switch (code)
diff --git a/gnu/usr.bin/gcc/gcc/doc/invoke.texi b/gnu/usr.bin/gcc/gcc/doc/invoke.texi
index 030103ac0c6..f3bc6261cfd 100644
--- a/gnu/usr.bin/gcc/gcc/doc/invoke.texi
+++ b/gnu/usr.bin/gcc/gcc/doc/invoke.texi
@@ -188,7 +188,7 @@ in the following sections.
-Weffc++ -Wno-deprecated @gol
-Wno-non-template-friend -Wold-style-cast @gol
-Woverloaded-virtual -Wno-pmf-conversions @gol
--Wsign-promo -Wsynth}
+-Wsign-promo}
@item Objective-C Language Options
@xref{Objective-C Dialect Options,,Options Controlling Objective-C Dialect}.
@@ -1716,29 +1716,6 @@ Warn when overload resolution chooses a promotion from unsigned or
enumeral type to a signed type, over a conversion to an unsigned type of
the same size. Previous versions of G++ would try to preserve
unsignedness, but the standard mandates the current behavior.
-
-@item -Wsynth @r{(C++ only)}
-@opindex Wsynth
-@cindex warning for synthesized methods
-@cindex synthesized methods, warning
-Warn when G++'s synthesis behavior does not match that of cfront. For
-instance:
-
-@smallexample
-struct A @{
- operator int ();
- A& operator = (int);
-@};
-
-main ()
-@{
- A a,b;
- a = b;
-@}
-@end smallexample
-
-In this example, G++ will synthesize a default @samp{A& operator =
-(const A&);}, while cfront will use the user-defined @samp{operator =}.
@end table
@node Objective-C Dialect Options
@@ -5705,7 +5682,7 @@ These @samp{-m} switches are supported on the SPARC:
@opindex mapp-regs
Specify @option{-mapp-regs} to generate output using the global registers
2 through 4, which the SPARC SVR4 ABI reserves for applications. This
-is the default.
+is the default, except on Solaris.
To be fully SVR4 ABI compliant at the cost of some performance loss,
specify @option{-mno-app-regs}. You should compile libraries and system
diff --git a/gnu/usr.bin/gcc/gcc/expr.c b/gnu/usr.bin/gcc/gcc/expr.c
index 1ff5794fc59..c54146f95e4 100644
--- a/gnu/usr.bin/gcc/gcc/expr.c
+++ b/gnu/usr.bin/gcc/gcc/expr.c
@@ -8480,9 +8480,14 @@ expand_expr (exp, target, tmode, modifier)
/* At this point, a MEM target is no longer useful; we will get better
code without it. */
- if (GET_CODE (target) == MEM)
+ if (! REG_P (target))
target = gen_reg_rtx (mode);
+ /* We generate better code and avoid problems with op1 mentioning
+ target by forcing op1 into a pseudo if it isn't a constant. */
+ if (! CONSTANT_P (op1))
+ op1 = force_reg (mode, op1);
+
if (target != op0)
emit_move_insn (target, op0);
diff --git a/gnu/usr.bin/gcc/gcc/function.c b/gnu/usr.bin/gcc/gcc/function.c
index ed8c8972f33..6585afc2bbb 100644
--- a/gnu/usr.bin/gcc/gcc/function.c
+++ b/gnu/usr.bin/gcc/gcc/function.c
@@ -233,9 +233,8 @@ static rtx assign_stack_local_1 PARAMS ((enum machine_mode, HOST_WIDE_INT,
int, struct function *));
static struct temp_slot *find_temp_slot_from_address PARAMS ((rtx));
static void put_reg_into_stack PARAMS ((struct function *, rtx, tree,
- enum machine_mode, enum machine_mode,
- int, unsigned int, int,
- htab_t));
+ enum machine_mode, unsigned int,
+ int, int, int, htab_t));
static void schedule_fixup_var_refs PARAMS ((struct function *, rtx, tree,
enum machine_mode,
htab_t));
@@ -515,6 +514,7 @@ get_frame_size ()
ALIGN controls the amount of alignment for the address of the slot:
0 means according to MODE,
-1 means use BIGGEST_ALIGNMENT and round size to multiple of that,
+ -2 means use BITS_PER_UNIT,
positive specifies alignment boundary in bits.
We do not round to stack_boundary here.
@@ -555,6 +555,8 @@ assign_stack_local_1 (mode, size, align, function)
alignment = BIGGEST_ALIGNMENT / BITS_PER_UNIT;
size = CEIL_ROUND (size, alignment);
}
+ else if (align == -2)
+ alignment = 1; /* BITS_PER_UNIT / BITS_PER_UNIT */
else
alignment = align / BITS_PER_UNIT;
@@ -1357,9 +1359,9 @@ put_var_into_stack (decl, rescan)
enum machine_mode promoted_mode, decl_mode;
struct function *function = 0;
tree context;
- int can_use_addressof;
- int volatilep = TREE_CODE (decl) != SAVE_EXPR && TREE_THIS_VOLATILE (decl);
- int usedp = (TREE_USED (decl)
+ int can_use_addressof_p;
+ int volatile_p = TREE_CODE (decl) != SAVE_EXPR && TREE_THIS_VOLATILE (decl);
+ int used_p = (TREE_USED (decl)
|| (TREE_CODE (decl) != SAVE_EXPR && DECL_INITIAL (decl) != 0));
context = decl_function_context (decl);
@@ -1406,7 +1408,7 @@ put_var_into_stack (decl, rescan)
/* If this variable lives in the current function and we don't need to put it
in the stack for the sake of setjmp or the non-locality, try to keep it in
a register until we know we actually need the address. */
- can_use_addressof
+ can_use_addressof_p
= (function == 0
&& ! (TREE_CODE (decl) != SAVE_EXPR && DECL_NONLOCAL (decl))
&& optimize > 0
@@ -1419,7 +1421,8 @@ put_var_into_stack (decl, rescan)
/* If we can't use ADDRESSOF, make sure we see through one we already
generated. */
- if (! can_use_addressof && GET_CODE (reg) == MEM
+ if (! can_use_addressof_p
+ && GET_CODE (reg) == MEM
&& GET_CODE (XEXP (reg, 0)) == ADDRESSOF)
reg = XEXP (XEXP (reg, 0), 0);
@@ -1427,11 +1430,11 @@ put_var_into_stack (decl, rescan)
if (GET_CODE (reg) == REG)
{
- if (can_use_addressof)
+ if (can_use_addressof_p)
gen_mem_addressof (reg, decl, rescan);
else
- put_reg_into_stack (function, reg, TREE_TYPE (decl), promoted_mode,
- decl_mode, volatilep, 0, usedp, 0);
+ put_reg_into_stack (function, reg, TREE_TYPE (decl), decl_mode,
+ 0, volatile_p, used_p, 0, 0);
}
else if (GET_CODE (reg) == CONCAT)
{
@@ -1447,14 +1450,14 @@ put_var_into_stack (decl, rescan)
#ifdef FRAME_GROWS_DOWNWARD
/* Since part 0 should have a lower address, do it second. */
put_reg_into_stack (function, hipart, part_type, part_mode,
- part_mode, volatilep, 0, 0, 0);
+ 0, volatile_p, 0, 0, 0);
put_reg_into_stack (function, lopart, part_type, part_mode,
- part_mode, volatilep, 0, 0, 0);
+ 0, volatile_p, 0, 1, 0);
#else
put_reg_into_stack (function, lopart, part_type, part_mode,
- part_mode, volatilep, 0, 0, 0);
+ 0, volatile_p, 0, 0, 0);
put_reg_into_stack (function, hipart, part_type, part_mode,
- part_mode, volatilep, 0, 0, 0);
+ 0, volatile_p, 0, 1, 0);
#endif
/* Change the CONCAT into a combined MEM for both parts. */
@@ -1475,7 +1478,7 @@ put_var_into_stack (decl, rescan)
/* Prevent sharing of rtl that might lose. */
if (GET_CODE (XEXP (reg, 0)) == PLUS)
XEXP (reg, 0) = copy_rtx (XEXP (reg, 0));
- if (usedp && rescan)
+ if (used_p && rescan)
{
schedule_fixup_var_refs (function, reg, TREE_TYPE (decl),
promoted_mode, 0);
@@ -1489,26 +1492,29 @@ put_var_into_stack (decl, rescan)
/* Subroutine of put_var_into_stack. This puts a single pseudo reg REG
into the stack frame of FUNCTION (0 means the current function).
+ TYPE is the user-level data type of the value hold in the register.
DECL_MODE is the machine mode of the user-level data type.
- PROMOTED_MODE is the machine mode of the register.
- VOLATILE_P is nonzero if this is for a "volatile" decl.
- USED_P is nonzero if this reg might have already been used in an insn. */
+ ORIGINAL_REGNO must be set if the real regno is not visible in REG.
+ VOLATILE_P is true if this is for a "volatile" decl.
+ USED_P is true if this reg might have already been used in an insn.
+ CONSECUTIVE_P is true if the stack slot assigned to reg must be
+ consecutive with the previous stack slot. */
static void
-put_reg_into_stack (function, reg, type, promoted_mode, decl_mode, volatile_p,
- original_regno, used_p, ht)
+put_reg_into_stack (function, reg, type, decl_mode, original_regno,
+ volatile_p, used_p, consecutive_p, ht)
struct function *function;
rtx reg;
tree type;
- enum machine_mode promoted_mode, decl_mode;
- int volatile_p;
+ enum machine_mode decl_mode;
unsigned int original_regno;
- int used_p;
+ int volatile_p, used_p, consecutive_p;
htab_t ht;
{
struct function *func = function ? function : cfun;
- rtx new = 0;
+ enum machine_mode mode = GET_MODE (reg);
unsigned int regno = original_regno;
+ rtx new = 0;
if (regno == 0)
regno = REGNO (reg);
@@ -1522,8 +1528,10 @@ put_reg_into_stack (function, reg, type, promoted_mode, decl_mode, volatile_p,
if (new == 0)
new = function ?
- assign_stack_local_1 (decl_mode, GET_MODE_SIZE (decl_mode), 0, func):
- assign_stack_local_for_pseudo_reg (decl_mode, GET_MODE_SIZE (decl_mode), 0);
+ assign_stack_local_1 (decl_mode, GET_MODE_SIZE (decl_mode),
+ consecutive_p ? -2 : 0, func):
+ assign_stack_local_for_pseudo_reg (decl_mode, GET_MODE_SIZE (decl_mode),
+ consecutive_p ? -2 : 0);
PUT_CODE (reg, MEM);
PUT_MODE (reg, decl_mode);
@@ -1545,7 +1553,7 @@ put_reg_into_stack (function, reg, type, promoted_mode, decl_mode, volatile_p,
}
if (used_p)
- schedule_fixup_var_refs (function, reg, type, promoted_mode, ht);
+ schedule_fixup_var_refs (function, reg, type, mode, ht);
}
/* Make sure that all refs to the variable, previously made
@@ -1733,7 +1741,7 @@ fixup_var_refs_insns_with_hash (ht, var, promoted_mode, unsignedp, may_share)
tmp.key = var;
ime = (struct insns_for_mem_entry *) htab_find (ht, &tmp);
for (insn_list = ime->insns; insn_list != 0; insn_list = XEXP (insn_list, 1))
- if (INSN_P (XEXP (insn_list, 0)))
+ if (INSN_P (XEXP (insn_list, 0)) && !INSN_DELETED_P (XEXP (insn_list, 0)))
fixup_var_refs_insn (XEXP (insn_list, 0), var, promoted_mode,
unsignedp, 1, may_share);
}
@@ -3042,8 +3050,8 @@ put_addressof_into_stack (r, ht)
used_p = 1;
}
- put_reg_into_stack (0, reg, type, GET_MODE (reg), GET_MODE (reg),
- volatile_p, ADDRESSOF_REGNO (r), used_p, ht);
+ put_reg_into_stack (0, reg, type, GET_MODE (reg), ADDRESSOF_REGNO (r),
+ volatile_p, used_p, 0, ht);
}
/* List of replacements made below in purge_addressof_1 when creating
diff --git a/gnu/usr.bin/gcc/gcc/reload1.c b/gnu/usr.bin/gcc/gcc/reload1.c
index 35f6b6fc55e..5f8102c8821 100644
--- a/gnu/usr.bin/gcc/gcc/reload1.c
+++ b/gnu/usr.bin/gcc/gcc/reload1.c
@@ -3390,6 +3390,16 @@ set_initial_elim_offsets ()
num_not_at_initial_offset = 0;
}
+/* Subroutine of set_initial_label_offsets called via for_each_eh_label. */
+
+static void set_initial_eh_label_offset PARAMS ((rtx));
+static void
+set_initial_eh_label_offset (label)
+ rtx label;
+{
+ set_label_offsets (label, NULL_RTX, 1);
+}
+
/* Initialize the known label offsets.
Set a known offset for each forced label to be at the initial offset
of each elimination. We do this because we assume that all
@@ -3406,6 +3416,8 @@ set_initial_label_offsets ()
for (x = forced_labels; x; x = XEXP (x, 1))
if (XEXP (x, 0))
set_label_offsets (XEXP (x, 0), NULL_RTX, 1);
+
+ for_each_eh_label (set_initial_eh_label_offset);
}
/* Set all elimination offsets to the known values for the code label given
diff --git a/gnu/usr.bin/gcc/gcc/rtl.h b/gnu/usr.bin/gcc/gcc/rtl.h
index 8529cb4fe84..ce09e5a974e 100644
--- a/gnu/usr.bin/gcc/gcc/rtl.h
+++ b/gnu/usr.bin/gcc/gcc/rtl.h
@@ -2133,6 +2133,8 @@ extern void regclass PARAMS ((rtx, int, FILE *));
extern void reg_scan PARAMS ((rtx, unsigned int, int));
extern void reg_scan_update PARAMS ((rtx, rtx, unsigned int));
extern void fix_register PARAMS ((const char *, int, int));
+extern void init_subregs_of_mode PARAMS ((void));
+extern void record_subregs_of_mode PARAMS ((rtx));
#ifdef HARD_CONST
extern void cannot_change_mode_set_regs PARAMS ((HARD_REG_SET *,
enum machine_mode,
diff --git a/gnu/usr.bin/gcc/gcc/unwind-dw2.c b/gnu/usr.bin/gcc/gcc/unwind-dw2.c
index 59c1e9c4237..f7599a7bc90 100644
--- a/gnu/usr.bin/gcc/gcc/unwind-dw2.c
+++ b/gnu/usr.bin/gcc/gcc/unwind-dw2.c
@@ -1,5 +1,5 @@
/* DWARF2 exception handling and frame unwind runtime interface routines.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GCC.
@@ -185,6 +185,11 @@ asm(".text\n"
inline _Unwind_Word
_Unwind_GetGR (struct _Unwind_Context *context, int index)
{
+#ifdef DWARF_ZERO_REG
+ if (index == DWARF_ZERO_REG)
+ return 0;
+#endif
+
/* This will segfault if the register hasn't been saved. */
_Unwind_Word reg = * (_Unwind_Word *) context->reg[index];
@@ -631,6 +636,10 @@ execute_stack_op (const unsigned char *op_ptr, const unsigned char *op_end,
case DW_OP_mul:
case DW_OP_or:
case DW_OP_plus:
+ case DW_OP_shl:
+ case DW_OP_shr:
+ case DW_OP_shra:
+ case DW_OP_xor:
case DW_OP_le:
case DW_OP_ge:
case DW_OP_eq:
diff --git a/gnu/usr.bin/gcc/gcc/version.c b/gnu/usr.bin/gcc/gcc/version.c
index 9d3959332a4..408b014155d 100644
--- a/gnu/usr.bin/gcc/gcc/version.c
+++ b/gnu/usr.bin/gcc/gcc/version.c
@@ -6,7 +6,7 @@
please modify this string to indicate that, e.g. by putting your
organization's name in parentheses at the end of the string. */
-const char version_string[] = "3.3.5 (propolice)";
+const char version_string[] = "3.3.6 (propolice)";
/* This is the location of the online document giving instructions for
reporting bugs. If you distribute a modified version of GCC,