+2009-02-18 Jason Merrill <jason@redhat.com>
+
+ PR target/39179
+ * tree-ssa-ccp.c (get_symbol_constant_value): Don't assume zero
+ value if DECL_EXTERNAL.
+ * tree-sra.c (sra_walk_gimple_assign): Likewise.
+ * target.h (gcc_target::binds_local_p): Clarify "module".
+ * tree.h (TREE_PUBLIC): Clarify "module".
+
2009-02-17 Xuepeng Guo <xuepeng.guo@intel.com>
PR target/38891
+2009-02-18 Jason Merrill <jason@redhat.com>
+
+ * cfns.h: Tweak pathname for cfns.gperf.
+
2009-02-13 Jason Merrill <jason@redhat.com>
PR c++/39070
/* ANSI-C code produced by gperf version 3.0.1 */
-/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C ../../gcc/gcc/cp/cfns.gperf */
+/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C ../../gcc/cp/cfns.gperf */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
-#line 1 "../../gcc/gcc/cp/cfns.gperf"
+#line 1 "../../gcc/cp/cfns.gperf"
#ifdef __GNUC__
__inline
if (!CODE_CONTAINS_STRUCT (TREE_CODE (node), TS_DECL_COMMON)
|| !DECL_LANG_SPECIFIC (node))
return;
+ if (TREE_CODE (node) == FUNCTION_DECL)
+ {
+ int flags = TFF_DECL_SPECIFIERS|TFF_RETURN_TYPE
+ |TFF_FUNCTION_DEFAULT_ARGUMENTS|TFF_EXCEPTION_SPECIFICATION ;
+ indent_to (file, indent + 3);
+ fprintf (file, " full-name \"%s\"", decl_as_string (node, flags));
+ }
+ else if (TREE_CODE (node) == TEMPLATE_DECL)
+ {
+ indent_to (file, indent + 3);
+ fprintf (file, " full-name \"%s\"",
+ decl_as_string (node, TFF_TEMPLATE_HEADER));
+ }
+
indent_to (file, indent + 3);
+ if (DECL_EXTERNAL (node) && DECL_NOT_REALLY_EXTERN (node))
+ fprintf (file, " not-really-extern");
if (TREE_CODE (node) == FUNCTION_DECL
&& DECL_PENDING_INLINE_INFO (node))
fprintf (file, " pending-inline-info %p",
case RECORD_TYPE:
case UNION_TYPE:
+ indent_to (file, indent + 4);
+ fprintf (file, "full-name \"%s\"",
+ type_as_string (node, TFF_CLASS_KEY_OR_ENUM));
break;
default:
indent_to (file, indent + 3);
if (TYPE_NEEDS_CONSTRUCTING (node))
- fputs ( "needs-constructor", file);
+ fputs ( " needs-constructor", file);
if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (node))
fputs (" needs-destructor", file);
if (TYPE_HAS_DEFAULT_CONSTRUCTOR (node))
bool (* in_small_data_p) (const_tree);
/* True if EXP names an object for which name resolution must resolve
- to the current module. */
+ to the current executable or shared library. */
bool (* binds_local_p) (const_tree);
/* Modify and return the identifier of a DECL's external name,
+2009-02-18 Jason Merrill <jason@redhat.com>
+
+ PR target/39179
+ * g++.dg/opt/const6.C: New test.
+
2009-02-18 H.J. Lu <hongjiu.lu@intel.com>
* gcc.dg/callabi/callabi.exp: Moved to ...
// This ensures that we get a dump whether or not the bug is present.
void fn() { }
-// { dg-final { scan-tree-dump-not "initialization" "gimple" { xfail *-*-* } } }
+// { dg-final { scan-tree-dump-not "initialization" "gimple" } }
// { dg-final { cleanup-tree-dump "gimple" } }
--- /dev/null
+// PR target/39179
+// Make sure that we don't optimize away the load from K::k.
+// { dg-options "-O2" }
+// { dg-final { scan-assembler _ZN1K1kE } }
+
+struct K {
+ static const unsigned k;
+};
+extern "C" void abort (void);
+int main() {
+ if ( K::k != 1 )
+ abort ();
+ return 1;
+}
if (TREE_CODE (op0) == NON_LVALUE_EXPR)
op0 = TREE_OPERAND (op0, 0);
+ again:
switch (TREE_CODE (op0))
{
case VAR_DECL:
case PARM_DECL:
+ case FUNCTION_DECL:
dump_function_name (buffer, op0);
break;
case ADDR_EXPR:
case INDIRECT_REF:
case NOP_EXPR:
- dump_generic_node (buffer, TREE_OPERAND (op0, 0), 0, 0, false);
- break;
+ op0 = TREE_OPERAND (op0, 0);
+ goto again;
case COND_EXPR:
pp_string (buffer, "(");
we'd been passed the constructor directly. Invoke INIT. */
else if (TREE_CODE (rhs) == VAR_DECL
&& TREE_STATIC (rhs)
+ && !DECL_EXTERNAL (rhs)
&& TREE_READONLY (rhs)
&& targetm.binds_local_p (rhs))
fns->init (lhs_elt, DECL_INITIAL (rhs), gsi);
have zero as the initializer if they may not be
overridden at link or run time. */
if (!val
+ && !DECL_EXTERNAL (sym)
&& targetm.binds_local_p (sym)
&& (INTEGRAL_TYPE_P (TREE_TYPE (sym))
|| SCALAR_FLOAT_TYPE_P (TREE_TYPE (sym))))
- return fold_convert (TREE_TYPE (sym), integer_zero_node);
+ return fold_convert (TREE_TYPE (sym), integer_zero_node);
}
return NULL_TREE;
(CONSTANT_CLASS_P (EXPR) && TREE_OVERFLOW (EXPR))
/* In a VAR_DECL, FUNCTION_DECL, NAMESPACE_DECL or TYPE_DECL,
- nonzero means name is to be accessible from outside this module.
+ nonzero means name is to be accessible from outside this translation unit.
In an IDENTIFIER_NODE, nonzero means an external declaration
- accessible from outside this module was previously seen
+ accessible from outside this translation unit was previously seen
for this name in an inner scope. */
#define TREE_PUBLIC(NODE) ((NODE)->base.public_flag)
}
/* Support narrowing pointer differences. */
- if (TREE_CODE (value) == POINTER_PLUS_EXPR)
- {
- ret = narrowing_initializer_constant_valid_p (value, endtype);
- if (ret != NULL_TREE)
- return ret;
- }
+ ret = narrowing_initializer_constant_valid_p (value, endtype);
+ if (ret != NULL_TREE)
+ return ret;
+
break;
case MINUS_EXPR: