From: Uros Bizjak Date: Wed, 22 Feb 2012 19:47:42 +0000 (+0100) Subject: re PR target/52330 (pr50305.c: valgrind problem on invalid asm) X-Git-Tag: releases/gcc-4.4.7~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60602c48ef9d755589fb8e007cb81e63a4fd669b;p=thirdparty%2Fgcc.git re PR target/52330 (pr50305.c: valgrind problem on invalid asm) PR target/52330 * config/i386/i386.c (ix86_print_operand) : Error out if x is not offsettable memory reference. testsuite/ChangeLog: PR target/52330 * gcc.target/i386/pr52330.c: New test. From-SVN: r184492 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c6f4672e32f2..ffa152a24a18 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-02-22 Uros Bizjak + + PR target/52330 + * config/i386/i386.c (ix86_print_operand) : Error out if x + is not offsettable memory reference. + 2012-01-15 Uros Bizjak PR rtl-optimization/51821 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 101374934a30..e86f7cf7f37e 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -11224,6 +11224,13 @@ print_operand (FILE *file, rtx x, int code) return; case 'H': + if (!offsettable_memref_p (x)) + { + output_operand_lossage ("operand is not an offsettable memory " + "reference, invalid operand " + "code 'H'"); + return; + } /* It doesn't actually matter what mode we use here, as we're only going to use this for printing. */ x = adjust_address_nv (x, DImode, 8); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c4c92f1920d9..35e1b386825e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-02-22 Uros Bizjak + + PR target/52330 + * gcc.target/i386/pr52330.c: New test. + 2012-01-20 Kai Tietz * g++.dg/torture/pr51344.C: Fix typo. diff --git a/gcc/testsuite/gcc.target/i386/pr52330.c b/gcc/testsuite/gcc.target/i386/pr52330.c new file mode 100644 index 000000000000..22ba0b21aeda --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr52330.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +void foo (int a) +{ + asm volatile ("# %H0" : : "r" (a)); /* { dg-error "not an offsettable" } */ +}