]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/42559 (ice in emit_block_move_hints with -O2)
authorRichard Guenther <rguenther@suse.de>
Fri, 1 Jan 2010 13:56:50 +0000 (13:56 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 1 Jan 2010 13:56:50 +0000 (13:56 +0000)
2010-01-01  Richard Guenther  <rguenther@suse.de>

PR middle-end/42559
* builtins.c (get_object_alignment): Do not use DECL_ALIGN
for LABEL_DECLs.

* gcc.c-torture/compile/pr42559.c: New testcase.

From-SVN: r155554

gcc/ChangeLog
gcc/builtins.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr42559.c [new file with mode: 0644]

index af1a94f7bc9e118d55873877fbaf847875adba5d..ecb340a812d03c008104d3a3a50e379c0b050007 100644 (file)
@@ -1,3 +1,9 @@
+2010-01-01  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/42559
+       * builtins.c (get_object_alignment): Do not use DECL_ALIGN
+       for LABEL_DECLs.
+
 2009-12-31  Jakub Jelinek  <jakub@redhat.com>
 
        * tree-dump.c (dump_options): Don't set TDF_NOUID for all.
index 53d74a25b17ede0bc0586644f1c872e78bb04fff..d48263c5478c0d00bcdca7bcfd43920f3ab7ec1b 100644 (file)
@@ -325,7 +325,8 @@ get_object_alignment (tree exp, unsigned int align, unsigned int max_align)
     }
   if (TREE_CODE (exp) == CONST_DECL)
     exp = DECL_INITIAL (exp);
-  if (DECL_P (exp))
+  if (DECL_P (exp)
+      && TREE_CODE (exp) != LABEL_DECL)
     align = MIN (inner, DECL_ALIGN (exp));
 #ifdef CONSTANT_ALIGNMENT
   else if (CONSTANT_CLASS_P (exp))
index 005b4ac4e9d0b616a26380bddc4049290b9ec1e1..b1efc4cb578b8f7da5d411ccc6bdbbc05824c02f 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-01  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/42559
+       * gcc.c-torture/compile/pr42559.c: New testcase.
+
 2009-12-30  Joseph Myers  <joseph@codesourcery.com>
 
        PR c/42439
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr42559.c b/gcc/testsuite/gcc.c-torture/compile/pr42559.c
new file mode 100644 (file)
index 0000000..25f7fd6
--- /dev/null
@@ -0,0 +1,8 @@
+void jumpfunc(int copy, void *p)
+{
+  void *l = &&jumplabel;
+  if (copy)
+    __builtin___memcpy_chk (p, l, 128, __builtin_object_size (p, 0));
+jumplabel:
+  return;
+}