public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/47975] New: ICE: in expand_shift, at expmed.c:2299 when using 256b vectors without -mavx
@ 2011-03-03 15:30 zsojka at seznam dot cz
  2011-03-03 16:01 ` [Bug target/47975] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: zsojka at seznam dot cz @ 2011-03-03 15:30 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: ICE: in expand_shift, at expmed.c:2299 when using 256b
                    vectors without -mavx
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu


Created attachment 23533
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23533
reduced testcase

$ gcc testcase.c
testcase.c: In function 'foo':
testcase.c:6:5: internal compiler error: in expand_shift, at expmed.c:2299
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ gcc-4.5.2 testcase.c
testcase.c: In function 'foo':
testcase.c:6:5: error: invalid operands to binary << (have '__vector(8) int'
and '__vector(8) int')

Tested revisions:
r170622 - crash
4.5 - code is rejected


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

* [Bug target/47975] ICE: in expand_shift, at expmed.c:2299 when using 256b vectors without -mavx
  2011-03-03 15:30 [Bug target/47975] New: ICE: in expand_shift, at expmed.c:2299 when using 256b vectors without -mavx zsojka at seznam dot cz
@ 2011-03-03 16:01 ` rguenth at gcc dot gnu.org
  2011-03-03 16:19 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-03 16:01 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.03.03 16:01:27
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-03 16:01:27 UTC ---
Confirmed.


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

* [Bug target/47975] ICE: in expand_shift, at expmed.c:2299 when using 256b vectors without -mavx
  2011-03-03 15:30 [Bug target/47975] New: ICE: in expand_shift, at expmed.c:2299 when using 256b vectors without -mavx zsojka at seznam dot cz
  2011-03-03 16:01 ` [Bug target/47975] " rguenth at gcc dot gnu.org
@ 2011-03-03 16:19 ` rguenth at gcc dot gnu.org
  2011-03-03 16:22 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-03 16:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-03 16:19:23 UTC ---
We lower the vector - vector shift to

<bb 2>:
  x.0_1 = x;
  x.1_2 = x;
  D.2689_4 = BIT_FIELD_REF <x.0_1, 128, 0>;
  D.2690_5 = BIT_FIELD_REF <x.1_2, 128, 0>;
  D.2691_6 = D.2689_4 << D.2690_5;
  D.2692_7 = BIT_FIELD_REF <x.0_1, 128, 128>;
  D.2693_8 = BIT_FIELD_REF <x.1_2, 128, 128>;
  D.2694_9 = D.2692_7 << D.2693_8;
  x.2_3 = {D.2691_6, D.2694_9};
  x = x.2_3;
  return;

but do not lower that shift further because type_for_widest_vector_mode
calls optab_handler with ashl_optab which happens because in
optab_for_tree_code
we have

    case LSHIFT_EXPR:
      if (VECTOR_MODE_P (TYPE_MODE (type)))
        {
          if (subtype == optab_vector)
            return TYPE_SATURATING (type) ? NULL : vashl_optab;

          gcc_assert (subtype == optab_scalar);
        }
      if (TYPE_SATURATING(type))
        return TYPE_UNSIGNED(type) ? usashl_optab : ssashl_optab;
      return ashl_optab;

and we have ...

#define TYPE_MODE(NODE) \
  (TREE_CODE (TYPE_CHECK (NODE)) == VECTOR_TYPE \
   ? vector_type_mode (NODE) : (NODE)->type.mode)

which returns BLKmode instead of V8SImode.  Bah to whoever introduced
that hack to TYPE_MODE.


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

* [Bug target/47975] ICE: in expand_shift, at expmed.c:2299 when using 256b vectors without -mavx
  2011-03-03 15:30 [Bug target/47975] New: ICE: in expand_shift, at expmed.c:2299 when using 256b vectors without -mavx zsojka at seznam dot cz
  2011-03-03 16:01 ` [Bug target/47975] " rguenth at gcc dot gnu.org
  2011-03-03 16:19 ` rguenth at gcc dot gnu.org
@ 2011-03-03 16:22 ` rguenth at gcc dot gnu.org
  2011-03-04 10:27 ` rguenth at gcc dot gnu.org
  2011-03-04 10:28 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-03 16:22 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-03 16:21:51 UTC ---
I have a patch.


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

* [Bug target/47975] ICE: in expand_shift, at expmed.c:2299 when using 256b vectors without -mavx
  2011-03-03 15:30 [Bug target/47975] New: ICE: in expand_shift, at expmed.c:2299 when using 256b vectors without -mavx zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2011-03-03 16:22 ` rguenth at gcc dot gnu.org
@ 2011-03-04 10:27 ` rguenth at gcc dot gnu.org
  2011-03-04 10:28 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-04 10:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-04 10:27:17 UTC ---
Author: rguenth
Date: Fri Mar  4 10:27:10 2011
New Revision: 170672

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170672
Log:
2011-03-04  Richard Guenther  <rguenther@suse.de>

    PR middle-end/47975
    * optabs.c (optab_for_tree_code): Do not use VECTOR_MODE_P.

    * gcc.dg/torture/pr47975.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr47975.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/optabs.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug target/47975] ICE: in expand_shift, at expmed.c:2299 when using 256b vectors without -mavx
  2011-03-03 15:30 [Bug target/47975] New: ICE: in expand_shift, at expmed.c:2299 when using 256b vectors without -mavx zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2011-03-04 10:27 ` rguenth at gcc dot gnu.org
@ 2011-03-04 10:28 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-04 10:28 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-04 10:27:51 UTC ---
Fixed.


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

end of thread, other threads:[~2011-03-04 10:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-03 15:30 [Bug target/47975] New: ICE: in expand_shift, at expmed.c:2299 when using 256b vectors without -mavx zsojka at seznam dot cz
2011-03-03 16:01 ` [Bug target/47975] " rguenth at gcc dot gnu.org
2011-03-03 16:19 ` rguenth at gcc dot gnu.org
2011-03-03 16:22 ` rguenth at gcc dot gnu.org
2011-03-04 10:27 ` rguenth at gcc dot gnu.org
2011-03-04 10:28 ` rguenth at gcc dot gnu.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).