public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/25203]  New: [4.0] enable checking failure in g++.dg/opt/mmx2.C
@ 2005-12-01 13:54 ghazi at gcc dot gnu dot org
  2005-12-01 13:57 ` [Bug c++/25203] " ghazi at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2005-12-01 13:54 UTC (permalink / raw)
  To: gcc-bugs

On i686-pc-linux-gnu with current gcc-4.0.x, I'm getting a failure in
g++.dg/opt/mmx2.C:
http://gcc.gnu.org/ml/gcc-testresults/2005-11/msg01435.html

I think it's triggered by turning on checking, because I don't see other people
getting the error.  I configured with: --enable-checking=yes,rtl

I get an ICE here:

Program received signal SIGSEGV, Segmentation fault.
memory_operand (op=0xabababab, mode=VOIDmode) at
../../egcc-4.0-SVN20051130/gcc/recog.c:1279
1279      if (GET_CODE (inner) == SUBREG)

Here the variable "inner" is set to op which is a parameter to the function
memory_operand().  And memory_operand() is passed operands[2] from
get_attr_memory().  The value is 0xabababab, i.e. uninitialized garbage.

In insn-extract.c, only if checking is enabled, the function insn_extract
memsets recog_data.operand ("operands" is a macro for this) to 0xab so that any
uninitialized areas get this value.

I don't see this failure with 4.1 or mainline.


-- 
           Summary: [4.0] enable checking failure in g++.dg/opt/mmx2.C
           Product: gcc
           Version: 4.0.3
            Status: UNCONFIRMED
          Keywords: ice-checking, ssemmx
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ghazi at gcc dot gnu dot org
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/25203] [4.0] enable checking failure in g++.dg/opt/mmx2.C
  2005-12-01 13:54 [Bug c++/25203] New: [4.0] enable checking failure in g++.dg/opt/mmx2.C ghazi at gcc dot gnu dot org
@ 2005-12-01 13:57 ` ghazi at gcc dot gnu dot org
  2005-12-03 20:06 ` [Bug target/25203] " ghazi at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2005-12-01 13:57 UTC (permalink / raw)
  To: gcc-bugs



-- 

ghazi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.3


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/25203] [4.0] enable checking failure in g++.dg/opt/mmx2.C
  2005-12-01 13:54 [Bug c++/25203] New: [4.0] enable checking failure in g++.dg/opt/mmx2.C ghazi at gcc dot gnu dot org
  2005-12-01 13:57 ` [Bug c++/25203] " ghazi at gcc dot gnu dot org
@ 2005-12-03 20:06 ` ghazi at gcc dot gnu dot org
  2006-01-15 22:51 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2005-12-03 20:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ghazi at gcc dot gnu dot org  2005-12-03 20:06 -------
Here's a reduced testcase, configure 4.0.x with --enable-checking=yes,rtl
--target=i686-pc-linux-gnu and compile with:

cc1plus -fpreprocessed mmx2.ii -quiet -dumpbase mmx2.C -mmmx -mtune=pentiumpro
-auxbase mmx2 -O2 -version -fmessage-length=0 -o mmx2.s


typedef int __m64 __attribute__ ((__vector_size__ (8)));

static __inline void
_mm_empty (void)
{
  __builtin_ia32_emms ();
}

static __inline __m64
_mm_set_pi32 (int __i1, int __i0)
{
  return (__m64) __builtin_ia32_vec_init_v2si (__i0, __i1);
}

static union u { __m64 m; long long l; } u;
extern "C" void abort (void);

__attribute__((noinline))
void bar (__m64 x)
{
  u.m = x;
}

int
main ()
{
  bar (_mm_set_pi32 (0x000000FF,0xFFFF00FF));
  _mm_empty ();
  if (u.l != 0xffffff00ffLL)
    abort ();
  return 0;
}


-- 


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/25203] [4.0] enable checking failure in g++.dg/opt/mmx2.C
  2005-12-01 13:54 [Bug c++/25203] New: [4.0] enable checking failure in g++.dg/opt/mmx2.C ghazi at gcc dot gnu dot org
  2005-12-01 13:57 ` [Bug c++/25203] " ghazi at gcc dot gnu dot org
  2005-12-03 20:06 ` [Bug target/25203] " ghazi at gcc dot gnu dot org
@ 2006-01-15 22:51 ` mmitchel at gcc dot gnu dot org
  2006-03-11  3:17 ` mmitchel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-15 22:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from mmitchel at gcc dot gnu dot org  2006-01-15 22:51 -------
I think we should understand this problem, at least, before 4.0.3.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/25203] [4.0] enable checking failure in g++.dg/opt/mmx2.C
  2005-12-01 13:54 [Bug c++/25203] New: [4.0] enable checking failure in g++.dg/opt/mmx2.C ghazi at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-01-15 22:51 ` mmitchel at gcc dot gnu dot org
@ 2006-03-11  3:17 ` mmitchel at gcc dot gnu dot org
  2006-04-07  5:30 ` roger at eyesopen dot com
  2007-02-03 16:05 ` gdr at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-03-11  3:17 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.3                       |4.0.4


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/25203] [4.0] enable checking failure in g++.dg/opt/mmx2.C
  2005-12-01 13:54 [Bug c++/25203] New: [4.0] enable checking failure in g++.dg/opt/mmx2.C ghazi at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-03-11  3:17 ` mmitchel at gcc dot gnu dot org
@ 2006-04-07  5:30 ` roger at eyesopen dot com
  2007-02-03 16:05 ` gdr at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: roger at eyesopen dot com @ 2006-04-07  5:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from roger at eyesopen dot com  2006-04-07 05:30 -------
This appears to be a problem with instruction attributes in the x86 backend,
and looks to be still present (but latent?) on mainline.

The problem is that i386.c's "memory" define_attr tries to determine whether
an insn is a "load" for insns of type "mmxadd" if either operands[1]
or operands[2] is a memory operand.  See the (match_operand 2 ...) line,
shortly after line 460 of i386.md.

This interacts badly with the definitions of the *movsi_1 and *movdi_1_rex64
define_insns where certain alternatives claim that they are of insn type
"mmxadd", even though they have only two operands.  This leads the generated
get_attr_memory to inspect the uninitialized operands[2] for these insns.

The problem can be corrected by changing the insn "type" attribute for the
problematic variants of *movsi_1 and *movdi_1_rex64.  Which "type" they should
be (and how that interacts with scheduling etc...) is beyond me.  Perhaps a
new "mmxclr" or "mmxunary" type, or resuse the existing "mmxcvt" type, to
denote unary MMX operations.  Alternatively, the "memory" attribute could be
made more complex to recognize these two exceptions.  Or a third alternative,
is to specify the "memory" attribute of these two insns explicitly.


-- 

roger at eyesopen dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-04-07 05:30:26
               date|                            |


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/25203] [4.0] enable checking failure in g++.dg/opt/mmx2.C
  2005-12-01 13:54 [Bug c++/25203] New: [4.0] enable checking failure in g++.dg/opt/mmx2.C ghazi at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-04-07  5:30 ` roger at eyesopen dot com
@ 2007-02-03 16:05 ` gdr at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: gdr at gcc dot gnu dot org @ 2007-02-03 16:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from gdr at gcc dot gnu dot org  2007-02-03 16:05 -------
Fixed in GCC0-4.1.0


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.0.4                       |4.1.0


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-02-03 16:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-01 13:54 [Bug c++/25203] New: [4.0] enable checking failure in g++.dg/opt/mmx2.C ghazi at gcc dot gnu dot org
2005-12-01 13:57 ` [Bug c++/25203] " ghazi at gcc dot gnu dot org
2005-12-03 20:06 ` [Bug target/25203] " ghazi at gcc dot gnu dot org
2006-01-15 22:51 ` mmitchel at gcc dot gnu dot org
2006-03-11  3:17 ` mmitchel at gcc dot gnu dot org
2006-04-07  5:30 ` roger at eyesopen dot com
2007-02-03 16:05 ` gdr at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).