From: Jakub Jelinek Date: Tue, 31 Aug 2010 16:13:14 +0000 (+0200) Subject: re PR middle-end/45461 (ICE: verify_gimple failed: INDIRECT_REF in gimple IL with... X-Git-Tag: upstream/12.2.0~90612 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f643366ab9164e19a2efce88f141b04c0002f48;p=platform%2Fupstream%2Fgcc.git re PR middle-end/45461 (ICE: verify_gimple failed: INDIRECT_REF in gimple IL with -fshort-enums and va_arg) PR middle-end/45461 * builtins.c (dummy_object): Return a MEM_REF instead of INDIRECT_REF. * gcc.dg/pr45461.c: New test. From-SVN: r163678 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 388de77..a7d6b1c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-08-31 Jakub Jelinek + + PR middle-end/45461 + * builtins.c (dummy_object): Return a MEM_REF instead of INDIRECT_REF. + 2010-08-31 Nathan Froyd * config/fr30/fr30.c (fr30_move_double): Delete `dregno' and extra diff --git a/gcc/builtins.c b/gcc/builtins.c index ff1141f..4b540d8 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -4741,7 +4741,7 @@ static tree dummy_object (tree type) { tree t = build_int_cst (build_pointer_type (type), 0); - return build1 (INDIRECT_REF, type, t); + return build2 (MEM_REF, type, t, t); } /* Gimplify __builtin_va_arg, aka VA_ARG_EXPR, which is not really a diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 286eb57..9f39d48 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-08-31 Jakub Jelinek + + PR middle-end/45461 + * gcc.dg/pr45461.c: New test. + 2010-08-31 Richard Guenther PR testsuite/45455 diff --git a/gcc/testsuite/gcc.dg/pr45461.c b/gcc/testsuite/gcc.dg/pr45461.c new file mode 100644 index 0000000..7968f733 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr45461.c @@ -0,0 +1,18 @@ +/* PR middle-end/45461 */ +/* { dg-do compile } */ + +#include + +int +foo (int i, ...) +{ + short e; + va_list ap; + va_start (ap, i); + e = va_arg (ap, short); /* { dg-warning "is promoted" } */ + va_end (ap); + return e; +} + +/* { dg-message "note: \\(so you should pass" "" {target *-*-* } 12 } */ +/* { dg-message "note: if this code" "" {target *-*-* } 12 } */