* tree-ssa-forwprop.c (simplify_switch_expr): Don't
optimize if DEF doesn't have integral type.
* gcc.dg/torture/pr29584.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118921
138bc75d-0d04-0410-961f-
82ee72b054a4
+2006-11-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/29584
+ * tree-ssa-forwprop.c (simplify_switch_expr): Don't
+ optimize if DEF doesn't have integral type.
+
2006-11-16 Mike Stump <mrs@apple.com>
* config/darwin.h (LINK_COMMAND_SPEC): Don't do dwarf stuff on
+2006-11-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/29584
+ * gcc.dg/torture/pr29584.c: New test.
+
2006-11-17 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/tree-ssa/stdarg-2.c, gcc.dg/tree-ssa/stdarg-4.c:
--- /dev/null
+/* PR middle-end/29584 */
+/* { dg-do compile } */
+
+extern void *foo1 (void);
+extern void foo2 (void);
+extern void foo3 (void *, void *);
+extern int foo4 (void);
+
+void
+bar (void)
+{
+ int i;
+ void *s;
+ for (i = 1; i < 4; i++)
+ {
+ if (foo4 ())
+ foo2 ();
+ switch (0x8000000UL + i * 0x400)
+ {
+ case 0x80000000UL ... 0x80000000UL + 0x3a000000UL - 1:
+ s = 0;
+ break;
+ default:
+ s = foo1 ();
+ }
+ foo3 ((void *) (0x8000000UL + i * 0x400), s);
+ }
+}
need_precision = TYPE_PRECISION (ti);
fail = false;
- if (TYPE_UNSIGNED (to) && !TYPE_UNSIGNED (ti))
+ if (! INTEGRAL_TYPE_P (ti))
+ fail = true;
+ else if (TYPE_UNSIGNED (to) && !TYPE_UNSIGNED (ti))
fail = true;
else if (!TYPE_UNSIGNED (to) && TYPE_UNSIGNED (ti))
need_precision += 1;