public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/34911]  New: [4.1/4.2/4.3 regression] ICE with vectors of bool
@ 2008-01-21 23:25 reichelt at gcc dot gnu dot org
  2008-01-21 23:26 ` [Bug c++/34911] " reichelt at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-01-21 23:25 UTC (permalink / raw)
  To: gcc-bugs

The following code snippet triggers an ICE since GCC 4.0.2:

============================================
bool foo() __attribute((vector_size(8)));

void bar()
{
  foo() & foo();
}
============================================

bug.cc: In function 'void bar()':
bug.cc:5: internal compiler error: in same_scalar_type_ignoring_signedness, at
c-common.c:7203
Please submit a full bug report, [etc.]

I'm not sure whether the code is valid or not, GCC 3.4.[56] accepted it,
but GCC 4.0.[01] rejected it.


-- 
           Summary: [4.1/4.2/4.3 regression] ICE with vectors of bool
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


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

* [Bug c++/34911] [4.1/4.2/4.3 regression] ICE with vectors of bool
  2008-01-21 23:25 [Bug c++/34911] New: [4.1/4.2/4.3 regression] ICE with vectors of bool reichelt at gcc dot gnu dot org
@ 2008-01-21 23:26 ` reichelt at gcc dot gnu dot org
  2008-01-22  4:58 ` [Bug c/34911] " pinskia at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-01-21 23:26 UTC (permalink / raw)
  To: gcc-bugs



-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.3


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


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

* [Bug c/34911] [4.1/4.2/4.3 regression] ICE with vectors of bool
  2008-01-21 23:25 [Bug c++/34911] New: [4.1/4.2/4.3 regression] ICE with vectors of bool reichelt at gcc dot gnu dot org
  2008-01-21 23:26 ` [Bug c++/34911] " reichelt at gcc dot gnu dot org
@ 2008-01-22  4:58 ` pinskia at gcc dot gnu dot org
  2008-01-22 10:56 ` rguenth at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-22  4:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-01-22 03:59 -------
THis also happens with the C front-end, using -Dbool=_Bool .

Confirmed.  4.0.1 (at least without checking) accepted this in C mode.  I think
we should reject bool vectors anyways.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
          Component|c++                         |c
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-22 03:59:10
               date|                            |


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


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

* [Bug c/34911] [4.1/4.2/4.3 regression] ICE with vectors of bool
  2008-01-21 23:25 [Bug c++/34911] New: [4.1/4.2/4.3 regression] ICE with vectors of bool reichelt at gcc dot gnu dot org
  2008-01-21 23:26 ` [Bug c++/34911] " reichelt at gcc dot gnu dot org
  2008-01-22  4:58 ` [Bug c/34911] " pinskia at gcc dot gnu dot org
@ 2008-01-22 10:56 ` rguenth at gcc dot gnu dot org
  2008-01-22 22:08 ` tromey at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-22 10:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2008-01-22 10:47 -------
Yep, we should reject them.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-valid-code           |accepts-invalid, ice-on-
                   |                            |invalid-code
           Priority|P3                          |P4


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


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

* [Bug c/34911] [4.1/4.2/4.3 regression] ICE with vectors of bool
  2008-01-21 23:25 [Bug c++/34911] New: [4.1/4.2/4.3 regression] ICE with vectors of bool reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-01-22 10:56 ` rguenth at gcc dot gnu dot org
@ 2008-01-22 22:08 ` tromey at gcc dot gnu dot org
  2008-01-22 22:15 ` pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-01-22 22:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tromey at gcc dot gnu dot org  2008-01-22 21:51 -------
It is easy to reject bools, but I wonder if that is enough.
It is interesting that handle_vector_size_attribute doesn't
call vector_mode_valid_p, but the corresponding mode attribute does.

Anyway, I can regtest & submit this if you think it is what we want.

Index: c-common.c
===================================================================
--- c-common.c  (revision 131731)
+++ c-common.c  (working copy)
@@ -6044,7 +6044,8 @@
       || (!SCALAR_FLOAT_MODE_P (orig_mode)
          && GET_MODE_CLASS (orig_mode) != MODE_INT
          && !ALL_SCALAR_FIXED_POINT_MODE_P (orig_mode))
-      || !host_integerp (TYPE_SIZE_UNIT (type), 1))
+      || !host_integerp (TYPE_SIZE_UNIT (type), 1)
+      || TREE_CODE (type) == BOOLEAN_TYPE)
     {
       error ("invalid vector type for attribute %qE", name);
       return NULL_TREE;


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at gcc dot gnu dot
                   |                            |org


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


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

* [Bug c/34911] [4.1/4.2/4.3 regression] ICE with vectors of bool
  2008-01-21 23:25 [Bug c++/34911] New: [4.1/4.2/4.3 regression] ICE with vectors of bool reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-01-22 22:08 ` tromey at gcc dot gnu dot org
@ 2008-01-22 22:15 ` pinskia at gcc dot gnu dot org
  2008-01-23  1:52 ` tromey at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-22 22:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2008-01-22 21:56 -------
(In reply to comment #3)
> It is interesting that handle_vector_size_attribute doesn't
> call vector_mode_valid_p, but the corresponding mode attribute does.

Because the vector_size attribute should be generic and not dependent on the
target support.  This is by design, later on in the middle-end, vector types
are decomposed if needed; that is if the target does not support that vector
mode.


-- 


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


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

* [Bug c/34911] [4.1/4.2/4.3 regression] ICE with vectors of bool
  2008-01-21 23:25 [Bug c++/34911] New: [4.1/4.2/4.3 regression] ICE with vectors of bool reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-01-22 22:15 ` pinskia at gcc dot gnu dot org
@ 2008-01-23  1:52 ` tromey at gcc dot gnu dot org
  2008-01-23  2:10 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-01-23  1:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from tromey at gcc dot gnu dot org  2008-01-23 01:05 -------
AFAICT vector_mode_valid_p knows about this fallback option.
Is that incorrect?  See the last line...


-- 


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


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

* [Bug c/34911] [4.1/4.2/4.3 regression] ICE with vectors of bool
  2008-01-21 23:25 [Bug c++/34911] New: [4.1/4.2/4.3 regression] ICE with vectors of bool reichelt at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-01-23  1:52 ` tromey at gcc dot gnu dot org
@ 2008-01-23  2:10 ` pinskia at gcc dot gnu dot org
  2008-07-04 22:29 ` [Bug c/34911] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-23  2:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2008-01-23 01:10 -------
(In reply to comment #5)
> AFAICT vector_mode_valid_p knows about this fallback option.
> Is that incorrect?  See the last line...

I think by the time we get here, targetm.scalar_mode_supported_p will have
already been checked so calling vector_mode_valid_p will not matter.


-- 


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


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

* [Bug c/34911] [4.2/4.3/4.4 regression] ICE with vectors of bool
  2008-01-21 23:25 [Bug c++/34911] New: [4.1/4.2/4.3 regression] ICE with vectors of bool reichelt at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-01-23  2:10 ` pinskia at gcc dot gnu dot org
@ 2008-07-04 22:29 ` jsm28 at gcc dot gnu dot org
  2009-01-01  3:58 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 22:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jsm28 at gcc dot gnu dot org  2008-07-04 22:29 -------
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2/4.3/4.4 regression]|[4.2/4.3/4.4 regression] ICE
                   |ICE with vectors of bool    |with vectors of bool
   Target Milestone|4.1.3                       |4.2.5


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


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

* [Bug c/34911] [4.2/4.3/4.4 regression] ICE with vectors of bool
  2008-01-21 23:25 [Bug c++/34911] New: [4.1/4.2/4.3 regression] ICE with vectors of bool reichelt at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-07-04 22:29 ` [Bug c/34911] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
@ 2009-01-01  3:58 ` pinskia at gcc dot gnu dot org
  2009-01-05 22:28 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-01  3:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pinskia at gcc dot gnu dot org  2009-01-01 03:56 -------
Here is an ICE for invalid code:
_Bool __attribute__((vector_size(16) )) a;
int __attribute__((vector_size(16) )) c;
void f(void) { a & c; }


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

* [Bug c/34911] [4.2/4.3 regression] ICE with vectors of bool
  2008-01-21 23:25 [Bug c++/34911] New: [4.1/4.2/4.3 regression] ICE with vectors of bool reichelt at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2009-01-05 22:28 ` pinskia at gcc dot gnu dot org
@ 2009-01-05 22:28 ` pinskia at gcc dot gnu dot org
  2009-03-31 20:19 ` [Bug c/34911] [4.3 " jsm28 at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-05 22:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pinskia at gcc dot gnu dot org  2009-01-05 22:28 -------
Fixed on the trunk at least.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.2/4.3/4.4 regression] ICE|[4.2/4.3 regression] ICE
                   |with vectors of bool        |with vectors of bool


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


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

* [Bug c/34911] [4.2/4.3/4.4 regression] ICE with vectors of bool
  2008-01-21 23:25 [Bug c++/34911] New: [4.1/4.2/4.3 regression] ICE with vectors of bool reichelt at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2009-01-01  3:58 ` pinskia at gcc dot gnu dot org
@ 2009-01-05 22:28 ` pinskia at gcc dot gnu dot org
  2009-01-05 22:28 ` [Bug c/34911] [4.2/4.3 " pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-05 22:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pinskia at gcc dot gnu dot org  2009-01-05 22:27 -------
Subject: Bug 34911

Author: pinskia
Date: Mon Jan  5 22:27:48 2009
New Revision: 143099

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143099
Log:
2009-01-05  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR c/34911
        * c-common.c (handle_vector_size_attribute): Also reject BOOLEAN_TYPE
types.

2009-01-05  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR c/34911
        * gcc.dg/vector-3.c: New testcase.
        * g++.dg/ext/vector15.C: New test.



Added:
    trunk/gcc/testsuite/g++.dg/ext/vector15.C
    trunk/gcc/testsuite/gcc.dg/vector-3.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-common.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c/34911] [4.3 regression] ICE with vectors of bool
  2008-01-21 23:25 [Bug c++/34911] New: [4.1/4.2/4.3 regression] ICE with vectors of bool reichelt at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2009-01-05 22:28 ` [Bug c/34911] [4.2/4.3 " pinskia at gcc dot gnu dot org
@ 2009-03-31 20:19 ` jsm28 at gcc dot gnu dot org
  2009-04-16 15:45 ` pinskia at gcc dot gnu dot org
  2009-04-22 15:31 ` rguenth at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-31 20:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jsm28 at gcc dot gnu dot org  2009-03-31 20:18 -------
Closing 4.2 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.2/4.3 regression] ICE    |[4.3 regression] ICE with
                   |with vectors of bool        |vectors of bool
   Target Milestone|4.2.5                       |4.3.4


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


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

* [Bug c/34911] [4.3 regression] ICE with vectors of bool
  2008-01-21 23:25 [Bug c++/34911] New: [4.1/4.2/4.3 regression] ICE with vectors of bool reichelt at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2009-03-31 20:19 ` [Bug c/34911] [4.3 " jsm28 at gcc dot gnu dot org
@ 2009-04-16 15:45 ` pinskia at gcc dot gnu dot org
  2009-04-22 15:31 ` rguenth at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-16 15:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from pinskia at gcc dot gnu dot org  2009-04-16 15:44 -------
I am no longer working on this one.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

* [Bug c/34911] [4.3 regression] ICE with vectors of bool
  2008-01-21 23:25 [Bug c++/34911] New: [4.1/4.2/4.3 regression] ICE with vectors of bool reichelt at gcc dot gnu dot org
                   ` (12 preceding siblings ...)
  2009-04-16 15:45 ` pinskia at gcc dot gnu dot org
@ 2009-04-22 15:31 ` rguenth at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-04-22 15:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from rguenth at gcc dot gnu dot org  2009-04-22 15:30 -------
WONTFIX for 4.3.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to fail|                            |4.3.3
      Known to work|                            |4.4.0
         Resolution|                            |FIXED
   Target Milestone|4.3.4                       |4.4.0


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


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

end of thread, other threads:[~2009-04-22 15:31 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-21 23:25 [Bug c++/34911] New: [4.1/4.2/4.3 regression] ICE with vectors of bool reichelt at gcc dot gnu dot org
2008-01-21 23:26 ` [Bug c++/34911] " reichelt at gcc dot gnu dot org
2008-01-22  4:58 ` [Bug c/34911] " pinskia at gcc dot gnu dot org
2008-01-22 10:56 ` rguenth at gcc dot gnu dot org
2008-01-22 22:08 ` tromey at gcc dot gnu dot org
2008-01-22 22:15 ` pinskia at gcc dot gnu dot org
2008-01-23  1:52 ` tromey at gcc dot gnu dot org
2008-01-23  2:10 ` pinskia at gcc dot gnu dot org
2008-07-04 22:29 ` [Bug c/34911] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2009-01-01  3:58 ` pinskia at gcc dot gnu dot org
2009-01-05 22:28 ` pinskia at gcc dot gnu dot org
2009-01-05 22:28 ` [Bug c/34911] [4.2/4.3 " pinskia at gcc dot gnu dot org
2009-03-31 20:19 ` [Bug c/34911] [4.3 " jsm28 at gcc dot gnu dot org
2009-04-16 15:45 ` pinskia at gcc dot gnu dot org
2009-04-22 15:31 ` rguenth 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).