re PR target/52330 (pr50305.c: valgrind problem on invalid asm)
authorUros Bizjak <uros@gcc.gnu.org>
Wed, 22 Feb 2012 19:12:09 +0000 (20:12 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Wed, 22 Feb 2012 19:12:09 +0000 (20:12 +0100)
PR target/52330
* config/i386/i386.c (ix86_print_operand) <case 'H'>: Error out if x
is not offsettable memory reference.

testsuite/ChangeLog:

PR target/52330
* gcc.target/i386/pr52330.c: New test.

From-SVN: r184488

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr52330.c [new file with mode: 0644]

index 70b924b62f259fcc79bdad3f4cffae33355ce3b2..48488afcf01a81c178b1c3a3361dbe55be3942e2 100644 (file)
@@ -1,3 +1,9 @@
+2012-02-22  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/52330
+       * config/i386/i386.c (ix86_print_operand) <case 'H'>: Error out if x
+       is not offsettable memory reference.
+
 2012-02-22  Georg-Johann Lay  <avr@gjlay.de>
 
        PR target/18145
@@ -7,7 +13,7 @@
 2012-02-22  Georg-Johann Lay  <avr@gjlay.de>
 
        * config/avr/avr.h (avr_accumulate_outgoing_args): Return int.
-       * config/avr/avr.c (avr_accumulate_outgoing_args): Return int.  
+       * config/avr/avr.c (avr_accumulate_outgoing_args): Return int.
 
 2012-02-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
 2012-02-14  Bernd Schmidt  <bernds@codesourcery.com>
 
        * haifa-sched.c (prune_ready_list): Ensure that if there is a
-       sched-group insn, it either remains alone or the entire list is
-       pruned.
+       sched-group insn, it either remains alone or the entire list is pruned.
 
 2012-02-14  Jonathan Wakely  <jwakely.gcc@gmail.com>
 
        * gcc.c (LINK_COMMAND_SPEC): Deal with -fgnu-tm.
        (GTM_SELF_SPECS): Define if not already defined.
        (driver_self_specs): Add GTM_SELF_SPECS.
-        * config/darwin.h (LINK_COMMAND_SPEC_A): Deal with -fgnu-tm.
-        (GTM_SELF_SPECS): Define.
+       * config/darwin.h (LINK_COMMAND_SPEC_A): Deal with -fgnu-tm.
+       (GTM_SELF_SPECS): Define.
        * config/i386/cygwin.h (GTM_SELF_SPECS): Likewise.
        * config/i386/mingw32.h (GTM_SELF_SPECS): Likewise.
 
        * cselib.c (expand_loc): Return sp, fp, hfp or cfa base reg right
        away if seen.
 
-       * cselib.c (dump_cselib_val): Don't assume l->setting_insn is
-       non-NULL.
+       * cselib.c (dump_cselib_val): Don't assume l->setting_insn is non-NULL.
 
        PR middle-end/52230
-       * omp-low.c (expand_omp_for): If a static schedule without
-       chunk size has NULL region->cont, force fd.chunk_size to be
-       integer_zero_node.
+       * omp-low.c (expand_omp_for): If a static schedule without chunk size
+       has NULL region->cont, force fd.chunk_size to be integer_zero_node.
 
 2012-02-13  Andrew MacLeod  <amacleod@redhat.com>
 
        disallow changes from SFmode to mode with different size in FP regs.
 
 2012-02-12  Robert Millan  <rmh@gnu.org>
-            Gerald Pfeifer <gerald@pfeifer.com>
+           Gerald Pfeifer <gerald@pfeifer.com>
 
        * ginclude/stddef.h [__FreeBSD_kernel__] (__size_t): Do not define.
        Tweak comment.
 2012-02-11  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/52132
-       * reg-stack.c (subst_stack_regs_in_debug_insn): Don't use
-       get_true_reg.
+       * reg-stack.c (subst_stack_regs_in_debug_insn): Don't use get_true_reg.
 
 2012-02-11  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/mips/mips-dspr2.md (mips_prepend): Mask operand 3 rather
        than operand 2.
 
-2012-02-02 Jan Hubicka  <jh@suse.cz>
-          Tom de Vries  <tom@codesourcery.com>
+2012-02-02  Jan Hubicka  <jh@suse.cz>
+           Tom de Vries  <tom@codesourcery.com>
 
        PR middle-end/51998
        * cgraphunit.c (cgraph_analyze_function): Break cyclic aliases.
index 7c5ed4da5790d791d4eff07ca8096139a0ead9fd..24dbc492e8470c793b918b905df56c1a48905e2c 100644 (file)
@@ -14091,6 +14091,13 @@ ix86_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);
index d52a3c94018d4522c2848700fd0bd1e03d769f0d..9134d73d439b9f6f2f68b074f23d71ce5b1679af 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-22  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/52330
+       * gcc.target/i386/pr52330.c: New test.
+
 2012-02-22  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/52335
@@ -10,8 +15,7 @@
 
 2012-02-21  Kai Tietz  <ktietz@redhat.com>
 
-       * gcc.dg/bf-ms-layout-3.c: Mark char typed bitfield
-       as extension.
+       * gcc.dg/bf-ms-layout-3.c: Mark char typed bitfield as extension.
 
 2012-02-21  Richard Guenther  <rguenther@suse.de>
 
 
 2012-02-14  Hans-Peter Nilsson  <hp@axis.com>
 
-       * lib/target-supports.exp (check_effective_target_fgnu_tm): New
-       proc.
+       * lib/target-supports.exp (check_effective_target_fgnu_tm): New proc.
        * gfortran.dg/trans-mem-skel.f90: Gate test on effective_target
-       fgnu_tm. 
+       fgnu_tm.
        * gcc.dg/lto/trans-mem-1_0.c, gcc.dg/lto/trans-mem-2_0.c,
        gcc.dg/lto/trans-mem-3_0.c, gcc.dg/lto/trans-mem-4_0.c: Ditto.
        * gcc.dg/tm/tm.exp: Gate the whole of gcc.dg/tm on
 
        * gcc.target/mips/mips-prepend-1.c: New test.
 
-2012-02-02 Jan Hubicka  <jh@suse.cz>
-          Tom de Vries  <tom@codesourcery.com>
+2012-02-02  Jan Hubicka  <jh@suse.cz>
+           Tom de Vries  <tom@codesourcery.com>
 
        PR middle-end/51998
        * testsuite/gcc.dg/alias-12.c: New testcase.
diff --git a/gcc/testsuite/gcc.target/i386/pr52330.c b/gcc/testsuite/gcc.target/i386/pr52330.c
new file mode 100644 (file)
index 0000000..22ba0b2
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+void foo (int a)
+{
+  asm volatile ("# %H0" : : "r" (a));  /* { dg-error "not an offsettable" } */
+}