public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/18282] New: PR c/17384 patch causes regression from 3.4.2
@ 2004-11-02 21:46 jakub at gcc dot gnu dot org
  2004-11-02 21:52 ` [Bug c/18282] [3.4 Regression] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: jakub at gcc dot gnu dot org @ 2004-11-02 21:46 UTC (permalink / raw)
  To: gcc-bugs

typedef enum { B1 = 1 } B;

B __attribute__ ((mode (QI))) b;

doesn't compile since 2004-10-13 on gcc-3_4-branch, while it is accepted
by GCC 3.3.x, 3.4.2 and current CVS HEAD.
enum with mode attribute is used e.g. by DHCP, so it would be bad if
3.4.3 was released with this.

-- 
           Summary: PR c/17384 patch causes regression from 3.4.2
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,mark at codesourcery dot
                    com,rth at redhat dot com


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


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

* [Bug c/18282] [3.4 Regression] PR c/17384 patch causes regression from 3.4.2
  2004-11-02 21:46 [Bug c/18282] New: PR c/17384 patch causes regression from 3.4.2 jakub at gcc dot gnu dot org
@ 2004-11-02 21:52 ` pinskia at gcc dot gnu dot org
  2004-11-02 23:14 ` [Bug c/18282] " rth at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-02 21:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-02 21:52 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2004-11-02 21:52:03
               date|                            |
            Summary|PR c/17384 patch causes     |[3.4 Regression] PR c/17384
                   |regression from 3.4.2       |patch causes regression from
                   |                            |3.4.2
   Target Milestone|---                         |3.4.4


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


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

* [Bug c/18282] PR c/17384 patch causes regression from 3.4.2
  2004-11-02 21:46 [Bug c/18282] New: PR c/17384 patch causes regression from 3.4.2 jakub at gcc dot gnu dot org
  2004-11-02 21:52 ` [Bug c/18282] [3.4 Regression] " pinskia at gcc dot gnu dot org
@ 2004-11-02 23:14 ` rth at gcc dot gnu dot org
  2004-11-02 23:18 ` mark at codesourcery dot com
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rth at gcc dot gnu dot org @ 2004-11-02 23:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2004-11-02 23:14 -------
NOT a regression.  The mode argument was IGNORED, silently, by previous versions.
See http://gcc.gnu.org/ml/gcc/2004-10/msg00715.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|rejects-valid               |
            Summary|[3.4 Regression] PR c/17384 |PR c/17384 patch causes
                   |patch causes regression from|regression from 3.4.2
                   |3.4.2                       |


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


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

* [Bug c/18282] PR c/17384 patch causes regression from 3.4.2
  2004-11-02 21:46 [Bug c/18282] New: PR c/17384 patch causes regression from 3.4.2 jakub at gcc dot gnu dot org
  2004-11-02 21:52 ` [Bug c/18282] [3.4 Regression] " pinskia at gcc dot gnu dot org
  2004-11-02 23:14 ` [Bug c/18282] " rth at gcc dot gnu dot org
@ 2004-11-02 23:18 ` mark at codesourcery dot com
  2004-11-03  7:45 ` jakub at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mark at codesourcery dot com @ 2004-11-02 23:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mark at codesourcery dot com  2004-11-02 23:18 -------
Subject: Re:  PR c/17384 patch causes regression from 3.4.2

Jakub --

Since Richard says this is not a regression, but rather a case where the 
compiler is now correctly diagnosing code that previously did not work 
as intended, please do not commit the patch.  Instead, however, it would 
be nice to have a note for changes.html on this topic.



-- 


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


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

* [Bug c/18282] PR c/17384 patch causes regression from 3.4.2
  2004-11-02 21:46 [Bug c/18282] New: PR c/17384 patch causes regression from 3.4.2 jakub at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-11-02 23:18 ` mark at codesourcery dot com
@ 2004-11-03  7:45 ` jakub at gcc dot gnu dot org
  2004-11-05  4:07 ` mmitchel at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu dot org @ 2004-11-03  7:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jakub at gcc dot gnu dot org  2004-11-03 07:45 -------
Seems the attribute worked before (and with the patch I posted on gcc-3_4-branch
as well) when used on a decl with enum type, but not when used on enum's typedef.

On the other side, current trunk works when it is used on the typedef, but not
when it is used on the decl:

typedef enum { B1 = 1, B2 = 2, B4 = 4, B8 = 8, B16 = 16 } B;
typedef enum { C1 = 1, C2 = 2, C4 = 4, C8 = 8, C16 = 16 } __attribute__ ((mode
(QI))) C;
typedef enum { D1 = 1, D2 = 2, D4 = 4, D8 = 8, D16 = 16 } __attribute__ ((mode
(word))) D;

B __attribute__ ((mode (QI))) bqi;
B __attribute__ ((mode (word))) bword;
int sqi[sizeof (bqi) == sizeof (int __attribute__((mode (QI)))) ? 1 : -1];
int sword[sizeof (bword) == sizeof (int __attribute__((mode (word)))) ? 1 : -1];
int sc[sizeof (C) == sizeof (int __attribute__((mode (QI)))) ? 1 : -1];
int sd[sizeof (D) == sizeof (int __attribute__((mode (word)))) ? 1 : -1];

GCC 3.3, 3.4.2, 3_4-branch + my patch:
I.c:10: error: size of array `sc' is negative
I.c:11: error: size of array `sd' is negative
GCC HEAD:
I.c:8: error: size of array 'sqi' is negative
I.c:9: error: size of array 'sword' is negative

If sizeof (bqi) == sizeof (int __attribute__((mode (QI)))) is supposed to be
1, then not applying the patch would mean there is a regression on 3_4-branch
and that is exactly the case DHCP is using, where apparently the mode was
not ignored.


-- 


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


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

* [Bug c/18282] PR c/17384 patch causes regression from 3.4.2
  2004-11-02 21:46 [Bug c/18282] New: PR c/17384 patch causes regression from 3.4.2 jakub at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-11-03  7:45 ` jakub at gcc dot gnu dot org
@ 2004-11-05  4:07 ` mmitchel at gcc dot gnu dot org
  2004-11-24 22:18 ` cvs-commit at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-11-05  4:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-11-05 04:07 -------
I'm not going to hold up 3.4.3 for this issue.

Richard's change makes this an error, so it's at most a rejects-valid. There's
also a good workaround: declare the enum __attribute__((packed)).  That's
probably a better choice anyhow.  I'll let you and Richard sort out what the
right semantics ought to be.  (FWIW, I think my sentiment is that this ought to
be like structures: you don't get to pick the mode, but you can say "packed" if
you want.)

-- 


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


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

* [Bug c/18282] PR c/17384 patch causes regression from 3.4.2
  2004-11-02 21:46 [Bug c/18282] New: PR c/17384 patch causes regression from 3.4.2 jakub at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-11-05  4:07 ` mmitchel at gcc dot gnu dot org
@ 2004-11-24 22:18 ` cvs-commit at gcc dot gnu dot org
  2004-12-09 18:26 ` rth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-11-24 22:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-11-24 22:18 -------
Subject: Bug 18282

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-rhl-branch
Changes by:	jakub@gcc.gnu.org	2004-11-24 22:18:16

Modified files:
	gcc            : ChangeLog c-common.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.c-torture/compile: 20041102-1.c 

Log message:
	PR c/18282
	* c-common.c (handle_mode_attribute): Allow mode attribute
	on enums when the mode is integral.
	
	* gcc.c-torture/compile/20041102-1.c: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=2.2326.2.399.2.55&r2=2.2326.2.399.2.56
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.476.4.6.2.7&r2=1.476.4.6.2.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=1.3389.2.170.2.28&r2=1.3389.2.170.2.29
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/20041102-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-rhl-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

* [Bug c/18282] PR c/17384 patch causes regression from 3.4.2
  2004-11-02 21:46 [Bug c/18282] New: PR c/17384 patch causes regression from 3.4.2 jakub at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-11-24 22:18 ` cvs-commit at gcc dot gnu dot org
@ 2004-12-09 18:26 ` rth at gcc dot gnu dot org
  2004-12-09 22:55 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rth at gcc dot gnu dot org @ 2004-12-09 18:26 UTC (permalink / raw)
  To: gcc-bugs



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


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


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

* [Bug c/18282] PR c/17384 patch causes regression from 3.4.2
  2004-11-02 21:46 [Bug c/18282] New: PR c/17384 patch causes regression from 3.4.2 jakub at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2004-12-09 18:26 ` rth at gcc dot gnu dot org
@ 2004-12-09 22:55 ` cvs-commit at gcc dot gnu dot org
  2004-12-09 22:57 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-12-09 22:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-12-09 22:55 -------
Subject: Bug 18282

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rth@gcc.gnu.org	2004-12-09 22:55:43

Modified files:
	gcc            : ChangeLog attribs.c c-common.c 

Log message:
	PR c/18282
	* attribs.c (decl_attributes): Use relayout_decl.
	* c-common.c (handle_mode_attribute): Copy all relevant type
	parameters from the new underlying integral type.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6763&r2=2.6764
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/attribs.c.diff?cvsroot=gcc&r1=1.34&r2=1.35
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&r1=1.592&r2=1.593



-- 


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


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

* [Bug c/18282] PR c/17384 patch causes regression from 3.4.2
  2004-11-02 21:46 [Bug c/18282] New: PR c/17384 patch causes regression from 3.4.2 jakub at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2004-12-09 22:55 ` cvs-commit at gcc dot gnu dot org
@ 2004-12-09 22:57 ` cvs-commit at gcc dot gnu dot org
  2004-12-10 19:23 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-12-09 22:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-12-09 22:57 -------
Subject: Bug 18282

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rth@gcc.gnu.org	2004-12-09 22:56:58

Added files:
	gcc/testsuite/gcc.dg: attr-mode-2.c 

Log message:
	Testcase for PR c/18282.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/attr-mode-2.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c/18282] PR c/17384 patch causes regression from 3.4.2
  2004-11-02 21:46 [Bug c/18282] New: PR c/17384 patch causes regression from 3.4.2 jakub at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2004-12-09 22:57 ` cvs-commit at gcc dot gnu dot org
@ 2004-12-10 19:23 ` cvs-commit at gcc dot gnu dot org
  2004-12-10 19:24 ` rth at gcc dot gnu dot org
  2004-12-23 23:51 ` cvs-commit at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-12-10 19:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-12-10 19:23 -------
Subject: Bug 18282

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	rth@gcc.gnu.org	2004-12-10 19:23:25

Modified files:
	gcc            : ChangeLog attribs.c c-common.c 
Added files:
	gcc/testsuite/gcc.dg: attr-mode-2.c 

Log message:
	PR c/18282
	* attribs.c (decl_attributes): Clear DECL_ALIGN when relaying out decl.
	* c-common.c (handle_mode_attribute): Handle enumeral types.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.726&r2=2.2326.2.727
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/attribs.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.28&r2=1.28.10.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.476.4.10&r2=1.476.4.11
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/attr-mode-2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

* [Bug c/18282] PR c/17384 patch causes regression from 3.4.2
  2004-11-02 21:46 [Bug c/18282] New: PR c/17384 patch causes regression from 3.4.2 jakub at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2004-12-10 19:23 ` cvs-commit at gcc dot gnu dot org
@ 2004-12-10 19:24 ` rth at gcc dot gnu dot org
  2004-12-23 23:51 ` cvs-commit at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: rth at gcc dot gnu dot org @ 2004-12-10 19:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2004-12-10 19:24 -------
Fixed.

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


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


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

* [Bug c/18282] PR c/17384 patch causes regression from 3.4.2
  2004-11-02 21:46 [Bug c/18282] New: PR c/17384 patch causes regression from 3.4.2 jakub at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2004-12-10 19:24 ` rth at gcc dot gnu dot org
@ 2004-12-23 23:51 ` cvs-commit at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-12-23 23:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-12-23 23:51 -------
Subject: Bug 18282

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	rth@gcc.gnu.org	2004-12-23 23:50:56

Modified files:
	gcc            : ChangeLog c-decl.c 

Log message:
	PR c/18282
	* c-decl.c (finish_enum): Retain precision acquired from an attribute.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.752&r2=2.2326.2.753
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.470.4.17&r2=1.470.4.18



-- 


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


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

end of thread, other threads:[~2004-12-23 23:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-02 21:46 [Bug c/18282] New: PR c/17384 patch causes regression from 3.4.2 jakub at gcc dot gnu dot org
2004-11-02 21:52 ` [Bug c/18282] [3.4 Regression] " pinskia at gcc dot gnu dot org
2004-11-02 23:14 ` [Bug c/18282] " rth at gcc dot gnu dot org
2004-11-02 23:18 ` mark at codesourcery dot com
2004-11-03  7:45 ` jakub at gcc dot gnu dot org
2004-11-05  4:07 ` mmitchel at gcc dot gnu dot org
2004-11-24 22:18 ` cvs-commit at gcc dot gnu dot org
2004-12-09 18:26 ` rth at gcc dot gnu dot org
2004-12-09 22:55 ` cvs-commit at gcc dot gnu dot org
2004-12-09 22:57 ` cvs-commit at gcc dot gnu dot org
2004-12-10 19:23 ` cvs-commit at gcc dot gnu dot org
2004-12-10 19:24 ` rth at gcc dot gnu dot org
2004-12-23 23:51 ` cvs-commit 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).