aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog54
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/c-lex.c7
-rw-r--r--gcc/config/arm/arm.c210
-rw-r--r--gcc/config/i386/i386.md99
-rw-r--r--gcc/config/rs6000/rs6000.c1
-rw-r--r--gcc/config/spu/spu.c5
-rwxr-xr-xgcc/configure3
-rw-r--r--gcc/configure.ac3
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/semantics.c2
-rw-r--r--gcc/dfp.c64
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/cpp.c18
-rw-r--r--gcc/fortran/cpp.h18
-rw-r--r--gcc/testsuite/ChangeLog9
-rw-r--r--gcc/testsuite/gcc.target/i386/bt-mask-1.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/bt-mask-2.c16
-rw-r--r--gcc/tree-flow.h1
-rw-r--r--gcc/tree-inline.c9
-rw-r--r--gcc/tree-ssa-alias.c17
-rw-r--r--gcc/tree-ssa-sink.c15
-rw-r--r--gcc/value-prof.c42
23 files changed, 495 insertions, 127 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bd7d2048dc0..8a8f88990e0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,57 @@
+2008-06-11 Joseph Myers <joseph@codesourcery.com>
+
+ * config/arm/arm.c (arm_init_neon_builtins): Move initialization
+ with function calls after declarations. Lay out
+ neon_float_type_node before further use.
+
+2008-06-11 Richard Guenther <rguenther@suse.de>
+
+ * tree-flow.h (may_point_to_global_var): Declare.
+ * tree-ssa-alias.c (may_point_to_global_var): New function.
+ * tree-ssa-sink.c (is_hidden_global_store): Use it.
+
+2008-06-10 Kazu Hirata <kazu@codesourcery.com>
+
+ * configure.ac: Teach that fido supports .debug_line.
+ * configure: Regenerate.
+
+2008-06-10 Tom Tromey <tromey@redhat.com>
+
+ * c-lex.c (fe_file_change): Pass SOURCE_LINE to start_source_file
+ debug hook.
+
+2008-06-10 Joseph Myers <joseph@codesourcery.com>
+
+ * dfp.c (WORDS_BIGENDIAN): Define to 0 if not defined.
+ (encode_decimal64, decode_decimal64, encode_decimal128,
+ decode_decimal128): Reverse order of 32-bit parts of value if host
+ and target endianness differ.
+
+2008-06-10 Vinodha Ramasamy <vinodha@google.com>
+ * value_prob.c (tree_divmod_fixed_value_transform): Use gcov_type.
+ Avoid division by 0.
+ (tree_mod_pow2_value_transform): Likewise.
+ (tree_ic_transform): Likewise.
+ (tree_stringops_transform): Likewise.
+ (tree_mod_subtract_transform): Likewise.
+ * tree-inline-c (copy_bb): Corrected int type to gcov_type.
+ (copy_edges_for_bb): Likewise.
+ (initialize_cfun): Likewise.
+
+2008-06-10 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*btdi_rex64): Change operand 1 predicate to
+ nonmemory_operand. Add "N" operand constraint.
+ (*btsi): Ditto.
+ (*jcc_btdi_mask_rex64): New instruction and split pattern.
+ (*jcc_btsi_mask): Ditto.
+ (*jcc_btsi_mask_1): Ditto.
+
+2008-06-10 Joseph Myers <joseph@codesourcery.com>
+
+ * config/rs6000/rs6000.c (build_opaque_vector_type): Set
+ TYPE_CANONICAL for copied element type.
+
2008-06-10 Uros Bizjak <ubizjak@gmail.com>
PR target/36473
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 02101f683e2..a4b03e33583 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20080610
+20080611
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index c3e7f6e3a16..c2a0fa350b5 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -205,10 +205,13 @@ fe_file_change (const struct line_map *new_map)
we already did in compile_file. */
if (!MAIN_FILE_P (new_map))
{
- int included_at = LAST_SOURCE_LINE_LOCATION (new_map - 1);
+ unsigned int included_at = LAST_SOURCE_LINE_LOCATION (new_map - 1);
+ int line = 0;
+ if (included_at > BUILTINS_LOCATION)
+ line = SOURCE_LINE (new_map - 1, included_at);
input_location = new_map->start_location;
- (*debug_hooks->start_source_file) (included_at, new_map->to_file);
+ (*debug_hooks->start_source_file) (line, new_map->to_file);
#ifndef NO_IMPLICIT_EXTERN_C
if (c_header_level)
++c_header_level;
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index e1ec23b3862..5df6a7722ed 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -15007,124 +15007,190 @@ arm_init_neon_builtins (void)
{
unsigned int i, fcode = ARM_BUILTIN_NEON_BASE;
+ tree neon_intQI_type_node;
+ tree neon_intHI_type_node;
+ tree neon_polyQI_type_node;
+ tree neon_polyHI_type_node;
+ tree neon_intSI_type_node;
+ tree neon_intDI_type_node;
+ tree neon_float_type_node;
+
+ tree intQI_pointer_node;
+ tree intHI_pointer_node;
+ tree intSI_pointer_node;
+ tree intDI_pointer_node;
+ tree float_pointer_node;
+
+ tree const_intQI_node;
+ tree const_intHI_node;
+ tree const_intSI_node;
+ tree const_intDI_node;
+ tree const_float_node;
+
+ tree const_intQI_pointer_node;
+ tree const_intHI_pointer_node;
+ tree const_intSI_pointer_node;
+ tree const_intDI_pointer_node;
+ tree const_float_pointer_node;
+
+ tree V8QI_type_node;
+ tree V4HI_type_node;
+ tree V2SI_type_node;
+ tree V2SF_type_node;
+ tree V16QI_type_node;
+ tree V8HI_type_node;
+ tree V4SI_type_node;
+ tree V4SF_type_node;
+ tree V2DI_type_node;
+
+ tree intUQI_type_node;
+ tree intUHI_type_node;
+ tree intUSI_type_node;
+ tree intUDI_type_node;
+
+ tree intEI_type_node;
+ tree intOI_type_node;
+ tree intCI_type_node;
+ tree intXI_type_node;
+
+ tree V8QI_pointer_node;
+ tree V4HI_pointer_node;
+ tree V2SI_pointer_node;
+ tree V2SF_pointer_node;
+ tree V16QI_pointer_node;
+ tree V8HI_pointer_node;
+ tree V4SI_pointer_node;
+ tree V4SF_pointer_node;
+ tree V2DI_pointer_node;
+
+ tree void_ftype_pv8qi_v8qi_v8qi;
+ tree void_ftype_pv4hi_v4hi_v4hi;
+ tree void_ftype_pv2si_v2si_v2si;
+ tree void_ftype_pv2sf_v2sf_v2sf;
+ tree void_ftype_pdi_di_di;
+ tree void_ftype_pv16qi_v16qi_v16qi;
+ tree void_ftype_pv8hi_v8hi_v8hi;
+ tree void_ftype_pv4si_v4si_v4si;
+ tree void_ftype_pv4sf_v4sf_v4sf;
+ tree void_ftype_pv2di_v2di_v2di;
+
+ tree reinterp_ftype_dreg[5][5];
+ tree reinterp_ftype_qreg[5][5];
+ tree dreg_types[5], qreg_types[5];
+
/* Create distinguished type nodes for NEON vector element types,
and pointers to values of such types, so we can detect them later. */
- tree neon_intQI_type_node = make_signed_type (GET_MODE_PRECISION (QImode));
- tree neon_intHI_type_node = make_signed_type (GET_MODE_PRECISION (HImode));
- tree neon_polyQI_type_node = make_signed_type (GET_MODE_PRECISION (QImode));
- tree neon_polyHI_type_node = make_signed_type (GET_MODE_PRECISION (HImode));
- tree neon_intSI_type_node = make_signed_type (GET_MODE_PRECISION (SImode));
- tree neon_intDI_type_node = make_signed_type (GET_MODE_PRECISION (DImode));
- tree neon_float_type_node = make_node (REAL_TYPE);
-
- tree intQI_pointer_node = build_pointer_type (neon_intQI_type_node);
- tree intHI_pointer_node = build_pointer_type (neon_intHI_type_node);
- tree intSI_pointer_node = build_pointer_type (neon_intSI_type_node);
- tree intDI_pointer_node = build_pointer_type (neon_intDI_type_node);
- tree float_pointer_node = build_pointer_type (neon_float_type_node);
+ neon_intQI_type_node = make_signed_type (GET_MODE_PRECISION (QImode));
+ neon_intHI_type_node = make_signed_type (GET_MODE_PRECISION (HImode));
+ neon_polyQI_type_node = make_signed_type (GET_MODE_PRECISION (QImode));
+ neon_polyHI_type_node = make_signed_type (GET_MODE_PRECISION (HImode));
+ neon_intSI_type_node = make_signed_type (GET_MODE_PRECISION (SImode));
+ neon_intDI_type_node = make_signed_type (GET_MODE_PRECISION (DImode));
+ neon_float_type_node = make_node (REAL_TYPE);
+ TYPE_PRECISION (neon_float_type_node) = FLOAT_TYPE_SIZE;
+ layout_type (neon_float_type_node);
+
+ intQI_pointer_node = build_pointer_type (neon_intQI_type_node);
+ intHI_pointer_node = build_pointer_type (neon_intHI_type_node);
+ intSI_pointer_node = build_pointer_type (neon_intSI_type_node);
+ intDI_pointer_node = build_pointer_type (neon_intDI_type_node);
+ float_pointer_node = build_pointer_type (neon_float_type_node);
/* Next create constant-qualified versions of the above types. */
- tree const_intQI_node = build_qualified_type (neon_intQI_type_node,
- TYPE_QUAL_CONST);
- tree const_intHI_node = build_qualified_type (neon_intHI_type_node,
- TYPE_QUAL_CONST);
- tree const_intSI_node = build_qualified_type (neon_intSI_type_node,
- TYPE_QUAL_CONST);
- tree const_intDI_node = build_qualified_type (neon_intDI_type_node,
- TYPE_QUAL_CONST);
- tree const_float_node = build_qualified_type (neon_float_type_node,
- TYPE_QUAL_CONST);
-
- tree const_intQI_pointer_node = build_pointer_type (const_intQI_node);
- tree const_intHI_pointer_node = build_pointer_type (const_intHI_node);
- tree const_intSI_pointer_node = build_pointer_type (const_intSI_node);
- tree const_intDI_pointer_node = build_pointer_type (const_intDI_node);
- tree const_float_pointer_node = build_pointer_type (const_float_node);
+ const_intQI_node = build_qualified_type (neon_intQI_type_node,
+ TYPE_QUAL_CONST);
+ const_intHI_node = build_qualified_type (neon_intHI_type_node,
+ TYPE_QUAL_CONST);
+ const_intSI_node = build_qualified_type (neon_intSI_type_node,
+ TYPE_QUAL_CONST);
+ const_intDI_node = build_qualified_type (neon_intDI_type_node,
+ TYPE_QUAL_CONST);
+ const_float_node = build_qualified_type (neon_float_type_node,
+ TYPE_QUAL_CONST);
+
+ const_intQI_pointer_node = build_pointer_type (const_intQI_node);
+ const_intHI_pointer_node = build_pointer_type (const_intHI_node);
+ const_intSI_pointer_node = build_pointer_type (const_intSI_node);
+ const_intDI_pointer_node = build_pointer_type (const_intDI_node);
+ const_float_pointer_node = build_pointer_type (const_float_node);
/* Now create vector types based on our NEON element types. */
/* 64-bit vectors. */
- tree V8QI_type_node =
+ V8QI_type_node =
build_vector_type_for_mode (neon_intQI_type_node, V8QImode);
- tree V4HI_type_node =
+ V4HI_type_node =
build_vector_type_for_mode (neon_intHI_type_node, V4HImode);
- tree V2SI_type_node =
+ V2SI_type_node =
build_vector_type_for_mode (neon_intSI_type_node, V2SImode);
- tree V2SF_type_node =
+ V2SF_type_node =
build_vector_type_for_mode (neon_float_type_node, V2SFmode);
/* 128-bit vectors. */
- tree V16QI_type_node =
+ V16QI_type_node =
build_vector_type_for_mode (neon_intQI_type_node, V16QImode);
- tree V8HI_type_node =
+ V8HI_type_node =
build_vector_type_for_mode (neon_intHI_type_node, V8HImode);
- tree V4SI_type_node =
+ V4SI_type_node =
build_vector_type_for_mode (neon_intSI_type_node, V4SImode);
- tree V4SF_type_node =
+ V4SF_type_node =
build_vector_type_for_mode (neon_float_type_node, V4SFmode);
- tree V2DI_type_node =
+ V2DI_type_node =
build_vector_type_for_mode (neon_intDI_type_node, V2DImode);
/* Unsigned integer types for various mode sizes. */
- tree intUQI_type_node = make_unsigned_type (GET_MODE_PRECISION (QImode));
- tree intUHI_type_node = make_unsigned_type (GET_MODE_PRECISION (HImode));
- tree intUSI_type_node = make_unsigned_type (GET_MODE_PRECISION (SImode));
- tree intUDI_type_node = make_unsigned_type (GET_MODE_PRECISION (DImode));
+ intUQI_type_node = make_unsigned_type (GET_MODE_PRECISION (QImode));
+ intUHI_type_node = make_unsigned_type (GET_MODE_PRECISION (HImode));
+ intUSI_type_node = make_unsigned_type (GET_MODE_PRECISION (SImode));
+ intUDI_type_node = make_unsigned_type (GET_MODE_PRECISION (DImode));
/* Opaque integer types for structures of vectors. */
- tree intEI_type_node = make_signed_type (GET_MODE_PRECISION (EImode));
- tree intOI_type_node = make_signed_type (GET_MODE_PRECISION (OImode));
- tree intCI_type_node = make_signed_type (GET_MODE_PRECISION (CImode));
- tree intXI_type_node = make_signed_type (GET_MODE_PRECISION (XImode));
+ intEI_type_node = make_signed_type (GET_MODE_PRECISION (EImode));
+ intOI_type_node = make_signed_type (GET_MODE_PRECISION (OImode));
+ intCI_type_node = make_signed_type (GET_MODE_PRECISION (CImode));
+ intXI_type_node = make_signed_type (GET_MODE_PRECISION (XImode));
/* Pointers to vector types. */
- tree V8QI_pointer_node = build_pointer_type (V8QI_type_node);
- tree V4HI_pointer_node = build_pointer_type (V4HI_type_node);
- tree V2SI_pointer_node = build_pointer_type (V2SI_type_node);
- tree V2SF_pointer_node = build_pointer_type (V2SF_type_node);
- tree V16QI_pointer_node = build_pointer_type (V16QI_type_node);
- tree V8HI_pointer_node = build_pointer_type (V8HI_type_node);
- tree V4SI_pointer_node = build_pointer_type (V4SI_type_node);
- tree V4SF_pointer_node = build_pointer_type (V4SF_type_node);
- tree V2DI_pointer_node = build_pointer_type (V2DI_type_node);
+ V8QI_pointer_node = build_pointer_type (V8QI_type_node);
+ V4HI_pointer_node = build_pointer_type (V4HI_type_node);
+ V2SI_pointer_node = build_pointer_type (V2SI_type_node);
+ V2SF_pointer_node = build_pointer_type (V2SF_type_node);
+ V16QI_pointer_node = build_pointer_type (V16QI_type_node);
+ V8HI_pointer_node = build_pointer_type (V8HI_type_node);
+ V4SI_pointer_node = build_pointer_type (V4SI_type_node);
+ V4SF_pointer_node = build_pointer_type (V4SF_type_node);
+ V2DI_pointer_node = build_pointer_type (V2DI_type_node);
/* Operations which return results as pairs. */
- tree void_ftype_pv8qi_v8qi_v8qi =
+ void_ftype_pv8qi_v8qi_v8qi =
build_function_type_list (void_type_node, V8QI_pointer_node, V8QI_type_node,
V8QI_type_node, NULL);
- tree void_ftype_pv4hi_v4hi_v4hi =
+ void_ftype_pv4hi_v4hi_v4hi =
build_function_type_list (void_type_node, V4HI_pointer_node, V4HI_type_node,
V4HI_type_node, NULL);
- tree void_ftype_pv2si_v2si_v2si =
+ void_ftype_pv2si_v2si_v2si =
build_function_type_list (void_type_node, V2SI_pointer_node, V2SI_type_node,
V2SI_type_node, NULL);
- tree void_ftype_pv2sf_v2sf_v2sf =
+ void_ftype_pv2sf_v2sf_v2sf =
build_function_type_list (void_type_node, V2SF_pointer_node, V2SF_type_node,
V2SF_type_node, NULL);
- tree void_ftype_pdi_di_di =
+ void_ftype_pdi_di_di =
build_function_type_list (void_type_node, intDI_pointer_node,
neon_intDI_type_node, neon_intDI_type_node, NULL);
- tree void_ftype_pv16qi_v16qi_v16qi =
+ void_ftype_pv16qi_v16qi_v16qi =
build_function_type_list (void_type_node, V16QI_pointer_node,
V16QI_type_node, V16QI_type_node, NULL);
- tree void_ftype_pv8hi_v8hi_v8hi =
+ void_ftype_pv8hi_v8hi_v8hi =
build_function_type_list (void_type_node, V8HI_pointer_node, V8HI_type_node,
V8HI_type_node, NULL);
- tree void_ftype_pv4si_v4si_v4si =
+ void_ftype_pv4si_v4si_v4si =
build_function_type_list (void_type_node, V4SI_pointer_node, V4SI_type_node,
V4SI_type_node, NULL);
- tree void_ftype_pv4sf_v4sf_v4sf =
+ void_ftype_pv4sf_v4sf_v4sf =
build_function_type_list (void_type_node, V4SF_pointer_node, V4SF_type_node,
V4SF_type_node, NULL);
- tree void_ftype_pv2di_v2di_v2di =
+ void_ftype_pv2di_v2di_v2di =
build_function_type_list (void_type_node, V2DI_pointer_node, V2DI_type_node,
V2DI_type_node, NULL);
- tree reinterp_ftype_dreg[5][5];
- tree reinterp_ftype_qreg[5][5];
- tree dreg_types[5], qreg_types[5];
-
- TYPE_PRECISION (neon_float_type_node) = FLOAT_TYPE_SIZE;
- layout_type (neon_float_type_node);
-
/* Define typedefs which exactly correspond to the modes we are basing vector
types on. If you change these names you'll need to change
the table used by arm_mangle_type too. */
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 738061d7048..886c1267824 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -13821,7 +13821,7 @@
(zero_extract:DI
(match_operand:DI 0 "register_operand" "r")
(const_int 1)
- (match_operand:DI 1 "register_operand" "r"))
+ (match_operand:DI 1 "nonmemory_operand" "rN"))
(const_int 0)))]
"TARGET_64BIT && (TARGET_USE_BT || optimize_size)"
"bt{q}\t{%1, %0|%0, %1}"
@@ -13833,7 +13833,7 @@
(zero_extract:SI
(match_operand:SI 0 "register_operand" "r")
(const_int 1)
- (match_operand:SI 1 "register_operand" "r"))
+ (match_operand:SI 1 "nonmemory_operand" "rN"))
(const_int 0)))]
"TARGET_USE_BT || optimize_size"
"bt{l}\t{%1, %0|%0, %1}"
@@ -14119,6 +14119,39 @@
PUT_CODE (operands[0], reverse_condition (GET_CODE (operands[0])));
})
+;; avoid useless masking of bit offset operand
+(define_insn_and_split "*jcc_btdi_mask_rex64"
+ [(set (pc)
+ (if_then_else (match_operator 0 "bt_comparison_operator"
+ [(zero_extract:DI
+ (match_operand:DI 1 "register_operand" "r")
+ (const_int 1)
+ (and:SI
+ (match_operand:SI 2 "register_operand" "r")
+ (match_operand:SI 3 "const_int_operand" "n")))])
+ (label_ref (match_operand 4 "" ""))
+ (pc)))]
+ "TARGET_64BIT && (TARGET_USE_BT || optimize_size)
+ && (INTVAL (operands[3]) & 0x3f) == 0x3f"
+ "#"
+ "&& 1"
+ [(set (reg:CCC FLAGS_REG)
+ (compare:CCC
+ (zero_extract:DI
+ (match_dup 1)
+ (const_int 1)
+ (match_dup 2))
+ (const_int 0)))
+ (set (pc)
+ (if_then_else (match_op_dup 0 [(reg:CCC FLAGS_REG) (const_int 0)])
+ (label_ref (match_dup 4))
+ (pc)))]
+{
+ operands[2] = simplify_gen_subreg (DImode, operands[2], SImode, 0);
+
+ PUT_CODE (operands[0], reverse_condition (GET_CODE (operands[0])));
+})
+
(define_insn_and_split "*jcc_btsi"
[(set (pc)
(if_then_else (match_operator 0 "bt_comparison_operator"
@@ -14150,6 +14183,35 @@
PUT_CODE (operands[0], reverse_condition (GET_CODE (operands[0])));
})
+;; avoid useless masking of bit offset operand
+(define_insn_and_split "*jcc_btsi_mask"
+ [(set (pc)
+ (if_then_else (match_operator 0 "bt_comparison_operator"
+ [(zero_extract:SI
+ (match_operand:SI 1 "register_operand" "r")
+ (const_int 1)
+ (and:SI
+ (match_operand:SI 2 "register_operand" "r")
+ (match_operand:SI 3 "const_int_operand" "n")))])
+ (label_ref (match_operand 4 "" ""))
+ (pc)))]
+ "(TARGET_USE_BT || optimize_size)
+ && (INTVAL (operands[3]) & 0x1f) == 0x1f"
+ "#"
+ "&& 1"
+ [(set (reg:CCC FLAGS_REG)
+ (compare:CCC
+ (zero_extract:SI
+ (match_dup 1)
+ (const_int 1)
+ (match_dup 2))
+ (const_int 0)))
+ (set (pc)
+ (if_then_else (match_op_dup 0 [(reg:CCC FLAGS_REG) (const_int 0)])
+ (label_ref (match_dup 4))
+ (pc)))]
+ "PUT_CODE (operands[0], reverse_condition (GET_CODE (operands[0])));")
+
(define_insn_and_split "*jcc_btsi_1"
[(set (pc)
(if_then_else (match_operator 0 "bt_comparison_operator"
@@ -14181,6 +14243,39 @@
PUT_CODE (operands[0], reverse_condition (GET_CODE (operands[0])));
})
+;; avoid useless masking of bit offset operand
+(define_insn_and_split "*jcc_btsi_mask_1"
+ [(set (pc)
+ (if_then_else
+ (match_operator 0 "bt_comparison_operator"
+ [(and:SI
+ (lshiftrt:SI
+ (match_operand:SI 1 "register_operand" "r")
+ (subreg:QI
+ (and:SI
+ (match_operand:SI 2 "register_operand" "r")
+ (match_operand:SI 3 "const_int_operand" "n")) 0))
+ (const_int 1))
+ (const_int 0)])
+ (label_ref (match_operand 4 "" ""))
+ (pc)))]
+ "(TARGET_USE_BT || optimize_size)
+ && (INTVAL (operands[3]) & 0x1f) == 0x1f"
+ "#"
+ "&& 1"
+ [(set (reg:CCC FLAGS_REG)
+ (compare:CCC
+ (zero_extract:SI
+ (match_dup 1)
+ (const_int 1)
+ (match_dup 2))
+ (const_int 0)))
+ (set (pc)
+ (if_then_else (match_op_dup 0 [(reg:CCC FLAGS_REG) (const_int 0)])
+ (label_ref (match_dup 4))
+ (pc)))]
+ "PUT_CODE (operands[0], reverse_condition (GET_CODE (operands[0])));")
+
;; Define combination compare-and-branch fp compare instructions to use
;; during early optimization. Splitting the operation apart early makes
;; for bad code when we want to reverse the operation.
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 91e1732a8f4..dcbccbca38e 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -9119,6 +9119,7 @@ build_opaque_vector_type (tree node, int nunits)
{
node = copy_node (node);
TYPE_MAIN_VARIANT (node) = node;
+ TYPE_CANONICAL (node) = node;
return build_vector_type (node, nunits);
}
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index b944a00e5bf..3fb339d0324 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -4479,7 +4479,7 @@ spu_init_builtins (void)
unsigned_V4SI_type_node = build_vector_type (unsigned_intSI_type_node, 4);
unsigned_V2DI_type_node = build_vector_type (unsigned_intDI_type_node, 2);
- spu_builtin_types[SPU_BTI_QUADWORD] = intTI_type_node;
+ spu_builtin_types[SPU_BTI_QUADWORD] = V16QI_type_node;
spu_builtin_types[SPU_BTI_7] = global_trees[TI_INTSI_TYPE];
spu_builtin_types[SPU_BTI_S7] = global_trees[TI_INTSI_TYPE];
@@ -5374,8 +5374,7 @@ spu_expand_builtin_1 (struct spu_builtin_description *d,
if (VECTOR_MODE_P (mode)
&& (GET_CODE (ops[i]) == CONST_INT
|| GET_MODE_CLASS (GET_MODE (ops[i])) == MODE_INT
- || GET_MODE_CLASS (GET_MODE (ops[i])) == MODE_FLOAT)
- && d->parm[i] != SPU_BTI_QUADWORD)
+ || GET_MODE_CLASS (GET_MODE (ops[i])) == MODE_FLOAT))
{
if (GET_CODE (ops[i]) == CONST_INT)
ops[i] = spu_const (mode, INTVAL (ops[i]));
diff --git a/gcc/configure b/gcc/configure
index 1f478817ac8..1d16aa0f689 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -22700,7 +22700,8 @@ esac
case "$target" in
i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
| x86_64*-*-* | hppa*-*-* | arm*-*-* \
- | xstormy16*-*-* | cris-*-* | xtensa-*-* | bfin-*-* | score*-*-* | spu-*-*)
+ | xstormy16*-*-* | cris-*-* | xtensa-*-* | bfin-*-* | score*-*-* \
+ | spu-*-* | fido*-*-*)
insn="nop"
;;
ia64*-*-* | s390*-*-*)
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 57be54a5b97..49dcf34a6dd 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -3060,7 +3060,8 @@ esac
case "$target" in
i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
| x86_64*-*-* | hppa*-*-* | arm*-*-* \
- | xstormy16*-*-* | cris-*-* | xtensa-*-* | bfin-*-* | score*-*-* | spu-*-*)
+ | xstormy16*-*-* | cris-*-* | xtensa-*-* | bfin-*-* | score*-*-* \
+ | spu-*-* | fido*-*-*)
insn="nop"
;;
ia64*-*-* | s390*-*-*)
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 74ae4ae4d98..897a54edb4e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/36408
+ * semantics.c (stmt_expr_value_expr): Don't crash on empty
+ STATEMENT_LIST.
+
2008-06-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/35242
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 83d23394cb5..f39b8d1eb17 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1778,7 +1778,7 @@ stmt_expr_value_expr (tree stmt_expr)
if (TREE_CODE (t) == BIND_EXPR)
t = BIND_EXPR_BODY (t);
- if (TREE_CODE (t) == STATEMENT_LIST)
+ if (TREE_CODE (t) == STATEMENT_LIST && STATEMENT_LIST_TAIL (t))
t = STATEMENT_LIST_TAIL (t)->stmt;
if (TREE_CODE (t) == EXPR_STMT)
diff --git a/gcc/dfp.c b/gcc/dfp.c
index fde3b84bda5..43262380af5 100644
--- a/gcc/dfp.c
+++ b/gcc/dfp.c
@@ -36,6 +36,10 @@ along with GCC; see the file COPYING3. If not see
#include "decimal32.h"
#include "decNumber.h"
+#ifndef WORDS_BIGENDIAN
+#define WORDS_BIGENDIAN 0
+#endif
+
/* Initialize R (a real with the decimal flag set) from DN. Can
utilize status passed in via CONTEXT, if a previous operation had
interesting status. */
@@ -173,8 +177,16 @@ encode_decimal64 (const struct real_format *fmt ATTRIBUTE_UNUSED,
decimal_to_decnumber (r, &dn);
decimal64FromNumber (&d64, &dn, &set);
- buf[0] = *(uint32_t *) &d64.bytes[0];
- buf[1] = *(uint32_t *) &d64.bytes[4];
+ if (WORDS_BIGENDIAN == FLOAT_WORDS_BIG_ENDIAN)
+ {
+ buf[0] = *(uint32_t *) &d64.bytes[0];
+ buf[1] = *(uint32_t *) &d64.bytes[4];
+ }
+ else
+ {
+ buf[0] = *(uint32_t *) &d64.bytes[4];
+ buf[1] = *(uint32_t *) &d64.bytes[0];
+ }
}
/* Decode an IEEE 754R decimal64 type into a real. */
@@ -190,8 +202,16 @@ decode_decimal64 (const struct real_format *fmt ATTRIBUTE_UNUSED,
decContextDefault (&set, DEC_INIT_DECIMAL128);
set.traps = 0;
- *((uint32_t *) &d64.bytes[0]) = (uint32_t) buf[0];
- *((uint32_t *) &d64.bytes[4]) = (uint32_t) buf[1];
+ if (WORDS_BIGENDIAN == FLOAT_WORDS_BIG_ENDIAN)
+ {
+ *((uint32_t *) &d64.bytes[0]) = (uint32_t) buf[0];
+ *((uint32_t *) &d64.bytes[4]) = (uint32_t) buf[1];
+ }
+ else
+ {
+ *((uint32_t *) &d64.bytes[0]) = (uint32_t) buf[1];
+ *((uint32_t *) &d64.bytes[4]) = (uint32_t) buf[0];
+ }
decimal64ToNumber (&d64, &dn);
decimal_from_decnumber (r, &dn, &set);
@@ -213,10 +233,20 @@ encode_decimal128 (const struct real_format *fmt ATTRIBUTE_UNUSED,
decimal_to_decnumber (r, &dn);
decimal128FromNumber (&d128, &dn, &set);
- buf[0] = *(uint32_t *) &d128.bytes[0];
- buf[1] = *(uint32_t *) &d128.bytes[4];
- buf[2] = *(uint32_t *) &d128.bytes[8];
- buf[3] = *(uint32_t *) &d128.bytes[12];
+ if (WORDS_BIGENDIAN == FLOAT_WORDS_BIG_ENDIAN)
+ {
+ buf[0] = *(uint32_t *) &d128.bytes[0];
+ buf[1] = *(uint32_t *) &d128.bytes[4];
+ buf[2] = *(uint32_t *) &d128.bytes[8];
+ buf[3] = *(uint32_t *) &d128.bytes[12];
+ }
+ else
+ {
+ buf[0] = *(uint32_t *) &d128.bytes[12];
+ buf[1] = *(uint32_t *) &d128.bytes[8];
+ buf[2] = *(uint32_t *) &d128.bytes[4];
+ buf[3] = *(uint32_t *) &d128.bytes[0];
+ }
}
/* Decode an IEEE 754R decimal128 type into a real. */
@@ -232,10 +262,20 @@ decode_decimal128 (const struct real_format *fmt ATTRIBUTE_UNUSED,
decContextDefault (&set, DEC_INIT_DECIMAL128);
set.traps = 0;
- *((uint32_t *) &d128.bytes[0]) = (uint32_t) buf[0];
- *((uint32_t *) &d128.bytes[4]) = (uint32_t) buf[1];
- *((uint32_t *) &d128.bytes[8]) = (uint32_t) buf[2];
- *((uint32_t *) &d128.bytes[12]) = (uint32_t) buf[3];
+ if (WORDS_BIGENDIAN == FLOAT_WORDS_BIG_ENDIAN)
+ {
+ *((uint32_t *) &d128.bytes[0]) = (uint32_t) buf[0];
+ *((uint32_t *) &d128.bytes[4]) = (uint32_t) buf[1];
+ *((uint32_t *) &d128.bytes[8]) = (uint32_t) buf[2];
+ *((uint32_t *) &d128.bytes[12]) = (uint32_t) buf[3];
+ }
+ else
+ {
+ *((uint32_t *) &d128.bytes[0]) = (uint32_t) buf[3];
+ *((uint32_t *) &d128.bytes[4]) = (uint32_t) buf[2];
+ *((uint32_t *) &d128.bytes[8]) = (uint32_t) buf[1];
+ *((uint32_t *) &d128.bytes[12]) = (uint32_t) buf[0];
+ }
decimal128ToNumber (&d128, &dn);
decimal_from_decnumber (r, &dn, &set);
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 205fc19f0c6..317fbe26231 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-10 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ * cpp.c: Add copyright notice.
+ * cpp.h: Add copyright notice.
+
2008-06-08 Janus Weil <janus@gcc.gnu.org>
PR fortran/36459
diff --git a/gcc/fortran/cpp.c b/gcc/fortran/cpp.c
index 170f6cdcd63..76ab9a3bad5 100644
--- a/gcc/fortran/cpp.c
+++ b/gcc/fortran/cpp.c
@@ -1,3 +1,21 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+
+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"
#include "system.h"
#include "coretypes.h"
diff --git a/gcc/fortran/cpp.h b/gcc/fortran/cpp.h
index e82b3cd1d43..6f409cc45ee 100644
--- a/gcc/fortran/cpp.h
+++ b/gcc/fortran/cpp.h
@@ -1,3 +1,21 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+
+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/>. */
+
#ifndef GFC_CPP_H
#define GFC_CPP_H
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1f6c771fa30..072a5cb948f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,8 +1,13 @@
2008-06-10 Uros Bizjak <ubizjak@gmail.com>
+ * gcc.target/i386/bt-mask-1.c: New test.
+ * gcc.target/i386/bt-mask-2.c: Ditto.
+
+2008-06-10 Uros Bizjak <ubizjak@gmail.com>
+
PR target/36473
- * testsuite/gcc.target/i386/bt-1.c: New test.
- * testsuite/gcc.target/i386/bt-2.c: Ditto.
+ * gcc.target/i386/bt-1.c: New test.
+ * gcc.target/i386/bt-2.c: Ditto.
2008-06-09 Andy Hutchinson <hutchinsonandy@aim.com>
diff --git a/gcc/testsuite/gcc.target/i386/bt-mask-1.c b/gcc/testsuite/gcc.target/i386/bt-mask-1.c
new file mode 100644
index 00000000000..bdcfd558a1b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/bt-mask-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mtune=core2" } */
+
+void foo (void);
+
+int test (int x, int n)
+{
+ n &= 0x1f;
+
+ if (x & (0x01 << n))
+ foo ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-not "and\[lq\]\[ \t\]" } } */
diff --git a/gcc/testsuite/gcc.target/i386/bt-mask-2.c b/gcc/testsuite/gcc.target/i386/bt-mask-2.c
new file mode 100644
index 00000000000..babfc2bcd36
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/bt-mask-2.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mtune=core2" } */
+
+void foo (void);
+
+int test (long x, long n)
+{
+ n &= 0x3f;
+
+ if (x & ((long)0x01 << n))
+ foo ();
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-not "and\[lq\]\[ \t\]" } } */
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 94d5a69f69c..45711ae3f12 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -853,6 +853,7 @@ extern void dump_points_to_info_for (FILE *, tree);
extern void debug_points_to_info_for (tree);
extern bool may_be_aliased (tree);
extern struct ptr_info_def *get_ptr_info (tree);
+extern bool may_point_to_global_var (tree);
extern void new_type_alias (tree, tree, tree);
extern void count_uses_and_derefs (tree, tree, unsigned *, unsigned *,
unsigned *);
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index a9ca33b14d4..cb97db1326b 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -795,7 +795,8 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
later */
static basic_block
-copy_bb (copy_body_data *id, basic_block bb, int frequency_scale, int count_scale)
+copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
+ gcov_type count_scale)
{
block_stmt_iterator bsi, copy_bsi;
basic_block copy_basic_block;
@@ -1108,7 +1109,7 @@ update_ssa_across_abnormal_edges (basic_block bb, basic_block ret_bb,
accordingly. Edges will be taken care of later. Assume aux
pointers to point to the copies of each BB. */
static void
-copy_edges_for_bb (basic_block bb, int count_scale, basic_block ret_bb)
+copy_edges_for_bb (basic_block bb, gcov_type count_scale, basic_block ret_bb)
{
basic_block new_bb = (basic_block) bb->aux;
edge_iterator ei;
@@ -1257,7 +1258,7 @@ initialize_cfun (tree new_fndecl, tree callee_fndecl, gcov_type count,
struct function *new_cfun
= (struct function *) ggc_alloc_cleared (sizeof (struct function));
struct function *src_cfun = DECL_STRUCT_FUNCTION (callee_fndecl);
- int count_scale, frequency_scale;
+ gcov_type count_scale, frequency_scale;
if (ENTRY_BLOCK_PTR_FOR_FUNCTION (src_cfun)->count)
count_scale = (REG_BR_PROB_BASE * count
@@ -1321,7 +1322,7 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency,
struct function *cfun_to_copy;
basic_block bb;
tree new_fndecl = NULL;
- int count_scale, frequency_scale;
+ gcov_type count_scale, frequency_scale;
int last;
if (ENTRY_BLOCK_PTR_FOR_FUNCTION (src_cfun)->count)
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 05c123c0e99..e89e73b9f59 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -2783,6 +2783,23 @@ may_alias_p (tree ptr, alias_set_type mem_alias_set,
return true;
}
+/* Return true, if PTR may point to a global variable. */
+
+bool
+may_point_to_global_var (tree ptr)
+{
+ struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
+
+ /* If we do not have points-to information for this variable,
+ we have to punt. */
+ if (!pi
+ || !pi->name_mem_tag)
+ return true;
+
+ /* The name memory tag is marked as global variable if the points-to
+ set contains a global variable. */
+ return is_global_var (pi->name_mem_tag);
+}
/* Add ALIAS to the set of variables that may alias VAR. */
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index 8945a612663..ebf54e2070b 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -189,20 +189,7 @@ is_hidden_global_store (tree stmt)
}
else if (INDIRECT_REF_P (lhs))
- {
- tree ptr = TREE_OPERAND (lhs, 0);
- struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
- tree nmt = (pi) ? pi->name_mem_tag : NULL_TREE;
- tree smt = symbol_mem_tag (SSA_NAME_VAR (ptr));
-
- /* If either the name tag or the symbol tag for PTR is a
- global variable, then the store is necessary. */
- if ((nmt && is_global_var (nmt))
- || (smt && is_global_var (smt)))
- {
- return true;
- }
- }
+ return may_point_to_global_var (TREE_OPERAND (lhs, 0));
else
gcc_unreachable ();
}
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index f1330def688..38ed8b25fdf 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -610,7 +610,7 @@ tree_divmod_fixed_value_transform (tree stmt)
enum tree_code code;
gcov_type val, count, all;
tree modify, op, op1, op2, result, value, tree_val;
- int prob;
+ gcov_type prob;
modify = stmt;
if (TREE_CODE (stmt) == RETURN_EXPR
@@ -651,7 +651,10 @@ tree_divmod_fixed_value_transform (tree stmt)
return false;
/* Compute probability of taking the optimal path. */
- prob = (count * REG_BR_PROB_BASE + all / 2) / all;
+ if (all > 0)
+ prob = (count * REG_BR_PROB_BASE + all / 2) / all;
+ else
+ prob = 0;
tree_val = build_int_cst_wide (get_gcov_type (),
(unsigned HOST_WIDE_INT) val,
@@ -770,7 +773,7 @@ tree_mod_pow2_value_transform (tree stmt)
enum tree_code code;
gcov_type count, wrong_values, all;
tree modify, op, op1, op2, result, value;
- int prob;
+ gcov_type prob;
modify = stmt;
if (TREE_CODE (stmt) == RETURN_EXPR
@@ -817,7 +820,10 @@ tree_mod_pow2_value_transform (tree stmt)
if (check_counter (stmt, "pow2", all, bb_for_stmt (stmt)->count))
return false;
- prob = (count * REG_BR_PROB_BASE + all / 2) / all;
+ if (all > 0)
+ prob = (count * REG_BR_PROB_BASE + all / 2) / all;
+ else
+ prob = 0;
result = tree_mod_pow2 (stmt, op, op1, op2, prob, count, all);
@@ -949,7 +955,7 @@ tree_mod_subtract_transform (tree stmt)
enum tree_code code;
gcov_type count, wrong_values, all;
tree modify, op, op1, op2, result, value;
- int prob1, prob2;
+ gcov_type prob1, prob2;
unsigned int i, steps;
gcov_type count1, count2;
@@ -1016,8 +1022,15 @@ tree_mod_subtract_transform (tree stmt)
}
/* Compute probability of taking the optimal path(s). */
- prob1 = (count1 * REG_BR_PROB_BASE + all / 2) / all;
- prob2 = (count2 * REG_BR_PROB_BASE + all / 2) / all;
+ if (all > 0)
+ {
+ prob1 = (count1 * REG_BR_PROB_BASE + all / 2) / all;
+ prob2 = (count2 * REG_BR_PROB_BASE + all / 2) / all;
+ }
+ else
+ {
+ prob1 = prob2 = 0;
+ }
/* In practice, "steps" is always 2. This interface reflects this,
and will need to be changed if "steps" can change. */
@@ -1174,7 +1187,7 @@ tree_ic_transform (tree stmt)
{
histogram_value histogram;
gcov_type val, count, all;
- int prob;
+ gcov_type prob;
tree call, callee, modify;
struct cgraph_node *direct_call;
@@ -1200,7 +1213,10 @@ tree_ic_transform (tree stmt)
if (4 * count <= 3 * all)
return false;
- prob = (count * REG_BR_PROB_BASE + all / 2) / all;
+ if (all > 0)
+ prob = (count * REG_BR_PROB_BASE + all / 2) / all;
+ else
+ prob = 0;
direct_call = find_func_by_pid ((int)val);
if (direct_call == NULL)
@@ -1365,7 +1381,7 @@ tree_stringops_transform (block_stmt_iterator *bsi)
tree value;
tree dest, src;
unsigned int dest_align, src_align;
- int prob;
+ gcov_type prob;
tree tree_val;
if (!call)
@@ -1399,7 +1415,10 @@ tree_stringops_transform (block_stmt_iterator *bsi)
return false;
if (check_counter (stmt, "value", all, bb_for_stmt (stmt)->count))
return false;
- prob = (count * REG_BR_PROB_BASE + all / 2) / all;
+ if (all > 0)
+ prob = (count * REG_BR_PROB_BASE + all / 2) / all;
+ else
+ prob = 0;
dest = CALL_EXPR_ARG (call, 0);
dest_align = get_pointer_alignment (dest, BIGGEST_ALIGNMENT);
switch (fcode)
@@ -1727,4 +1746,3 @@ value_profile_transformations (void)
return (value_prof_hooks->value_profile_transformations) ();
}
-