------- Comment #1 from rguenth at gcc dot gnu dot org  2010-04-08 15:11 -------
Well, we have not properly gimplified the invalid function:

doit ()
{
  char * pk;
  char * pk.1;
  char * pk.0;

<bb 2>:
  pk = 0B;

<bb 3>:
  __asm__ __volatile__("nop"::"m" pk);
  pk = pk + 1;
  pk.0 = pk;
  __asm__ __volatile__("nop"::"m" pk.0);
  pk.1 = pk.0 + 1;
  pk = pk.1;
  goto <bb 3>;


pk is addressable, so pk + 1 needs to load from pk first.

3.4.x prints

t.i: In function `doit':
t.i:6: warning: use of memory input without lvalue in asm operand 0 is
deprecated
t.i:7: warning: use of memory input without lvalue in asm operand 0 is
deprecated
t.i:6: error: impossible constraint in `asm'
t.i:7: error: impossible constraint in `asm'

so we ICE on the invalid asm.

We also fail to diagnose this with newer compilers (but the gimple verifier
triggers with checking enabled).


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|c                           |middle-end
     Ever Confirmed|0                           |1
  GCC build triplet|i486-linux-gnu              |
   GCC host triplet|i486-linux-gnu              |
 GCC target triplet|avr                         |
           Keywords|                            |diagnostic, ice-on-invalid-
                   |                            |code
      Known to fail|                            |4.1.2 4.3.4 4.4.4 4.5.0
                   |                            |4.6.0
      Known to work|                            |3.4.6
   Last reconfirmed|0000-00-00 00:00:00         |2010-04-08 15:11:43
               date|                            |
            Summary|Internal compiler error     |[4.3/4.4/4.5 Regression]
                   |detected by avr-gcc.        |Internal compiler error
                   |                            |detected by avr-gcc.
   Target Milestone|---                         |4.3.5


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43690

Reply via email to