public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/37985]  New: unsigned char shift lacks "statement with no effect" warning
@ 2008-11-01 10:55 tkoenig at gcc dot gnu dot org
  2008-11-01 12:50 ` [Bug c/37985] " rguenth at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2008-11-01 10:55 UTC (permalink / raw)
  To: gcc-bugs

I would have expected a warning "statement with no effect"
for this code:

$ cat tmp.c
unsigned char foo(unsigned char a)
{
  a >> 2;
  return a;
}
$ gcc -S -Wall -O3 -Wextra tmp.c
$


-- 
           Summary: unsigned char shift lacks "statement with no effect"
                    warning
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org


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


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

* [Bug c/37985] unsigned char shift lacks "statement with no effect" warning
  2008-11-01 10:55 [Bug c/37985] New: unsigned char shift lacks "statement with no effect" warning tkoenig at gcc dot gnu dot org
@ 2008-11-01 12:50 ` rguenth at gcc dot gnu dot org
  2009-03-30  1:38 ` tromey at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-11-01 12:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2008-11-01 12:48 -------
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-11-01 12:48:50
               date|                            |


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


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

* [Bug c/37985] unsigned char shift lacks "statement with no effect" warning
  2008-11-01 10:55 [Bug c/37985] New: unsigned char shift lacks "statement with no effect" warning tkoenig at gcc dot gnu dot org
  2008-11-01 12:50 ` [Bug c/37985] " rguenth at gcc dot gnu dot org
@ 2009-03-30  1:38 ` tromey at gcc dot gnu dot org
  2009-05-21 16:32 ` [Bug c/37985] [4.3/4.4/4.5 Regression] " tkoenig at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at gcc dot gnu dot org @ 2009-03-30  1:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tromey at gcc dot gnu dot org  2009-03-30 01:38 -------
convert_to_integer sets TREE_NO_WARNING on the shift,
causing cc1 to later bypass the warning.

#0  convert_to_integer (type=0xb7cf62d8, expr=0xb7cee630)
    at ../../trunk/gcc/convert.c:542
#1  0x080a7069 in convert (type=0xb7cf62d8, expr=0xb7cee630)
    at ../../trunk/gcc/c-convert.c:101
#2  0x080a4769 in build_binary_op (location=334, code=RSHIFT_EXPR, 
    orig_op0=0xb7cef1e0, orig_op1=0xb7d09054, convert_p=1)
    at ../../trunk/gcc/c-typeck.c:8573
#3  0x0808bb56 in parser_build_binary_op (location=334, code=RSHIFT_EXPR, arg1=
      {value = 0xb7cef1e0, original_code = ERROR_MARK}, arg2=
      {value = 0xb7d09054, original_code = ERROR_MARK})
    at ../../trunk/gcc/c-typeck.c:2794
#4  0x080fb741 in c_parser_binary_expression (parser=0xb7d80850, after=0x0)
    at ../../trunk/gcc/c-parser.c:4738


-- 

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=37985


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

* [Bug c/37985] [4.3/4.4/4.5 Regression] unsigned char shift lacks "statement with no effect" warning
  2008-11-01 10:55 [Bug c/37985] New: unsigned char shift lacks "statement with no effect" warning tkoenig at gcc dot gnu dot org
  2008-11-01 12:50 ` [Bug c/37985] " rguenth at gcc dot gnu dot org
  2009-03-30  1:38 ` tromey at gcc dot gnu dot org
@ 2009-05-21 16:32 ` tkoenig at gcc dot gnu dot org
  2009-05-21 16:33 ` tkoenig at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2009-05-21 16:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tkoenig at gcc dot gnu dot org  2009-05-21 16:31 -------
Works with 3.4:

$ cat > tmp.c
unsigned char foo(unsigned char a)
{
  a >> 2;
  return a;
}
$ gcc-3.4 -S -O3 -Wall tmp.c
tmp.c: In function `foo':
tmp.c:3: warning: statement with no effect


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.4.0 4.5.0 4.3.3
            Summary|unsigned char shift lacks   |[4.3/4.4/4.5 Regression]
                   |"statement with no effect"  |unsigned char shift lacks
                   |warning                     |"statement with no effect"
                   |                            |warning
   Target Milestone|---                         |4.3.5


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


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

* [Bug c/37985] [4.3/4.4/4.5 Regression] unsigned char shift lacks "statement with no effect" warning
  2008-11-01 10:55 [Bug c/37985] New: unsigned char shift lacks "statement with no effect" warning tkoenig at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-05-21 16:32 ` [Bug c/37985] [4.3/4.4/4.5 Regression] " tkoenig at gcc dot gnu dot org
@ 2009-05-21 16:33 ` tkoenig at gcc dot gnu dot org
  2009-05-23 11:42 ` tkoenig at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2009-05-21 16:33 UTC (permalink / raw)
  To: gcc-bugs



-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.5                       |4.3.4


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


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

* [Bug c/37985] [4.3/4.4/4.5 Regression] unsigned char shift lacks "statement with no effect" warning
  2008-11-01 10:55 [Bug c/37985] New: unsigned char shift lacks "statement with no effect" warning tkoenig at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2009-05-21 16:33 ` tkoenig at gcc dot gnu dot org
@ 2009-05-23 11:42 ` tkoenig at gcc dot gnu dot org
  2009-05-24 19:03 ` tkoenig at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2009-05-23 11:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from tkoenig at gcc dot gnu dot org  2009-05-23 11:42 -------
AFAIK, P3 regressions cannot be "enhancement", setting
severity to "normal".


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |normal


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


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

* [Bug c/37985] [4.3/4.4/4.5 Regression] unsigned char shift lacks "statement with no effect" warning
  2008-11-01 10:55 [Bug c/37985] New: unsigned char shift lacks "statement with no effect" warning tkoenig at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2009-05-23 11:42 ` tkoenig at gcc dot gnu dot org
@ 2009-05-24 19:03 ` tkoenig at gcc dot gnu dot org
  2009-05-28 14:43 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2009-05-24 19:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from tkoenig at gcc dot gnu dot org  2009-05-24 19:03 -------
Switching the "known to fail" versions around to make this bug appear
on the 4.5.0 regression list... maybe this will work.


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|4.4.0 4.5.0 4.3.3           |4.3.3 4.4.0 4.5.0


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


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

* [Bug c/37985] [4.3/4.4/4.5 Regression] unsigned char shift lacks "statement with no effect" warning
  2008-11-01 10:55 [Bug c/37985] New: unsigned char shift lacks "statement with no effect" warning tkoenig at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2009-05-24 19:03 ` tkoenig at gcc dot gnu dot org
@ 2009-05-28 14:43 ` rguenth at gcc dot gnu dot org
  2009-08-04 12:43 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-28 14:43 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug c/37985] [4.3/4.4/4.5 Regression] unsigned char shift lacks "statement with no effect" warning
  2008-11-01 10:55 [Bug c/37985] New: unsigned char shift lacks "statement with no effect" warning tkoenig at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2009-05-28 14:43 ` rguenth at gcc dot gnu dot org
@ 2009-08-04 12:43 ` rguenth at gcc dot gnu dot org
  2010-05-22 18:27 ` [Bug c/37985] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org
  2010-09-04 11:35 ` simartin at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-08-04 12:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2009-08-04 12:29 -------
GCC 4.3.4 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.4                       |4.3.5


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


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

* [Bug c/37985] [4.3/4.4/4.5/4.6 Regression] unsigned char shift lacks "statement with no effect" warning
  2008-11-01 10:55 [Bug c/37985] New: unsigned char shift lacks "statement with no effect" warning tkoenig at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2009-08-04 12:43 ` rguenth at gcc dot gnu dot org
@ 2010-05-22 18:27 ` rguenth at gcc dot gnu dot org
  2010-09-04 11:35 ` simartin at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-22 18:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from rguenth at gcc dot gnu dot org  2010-05-22 18:12 -------
GCC 4.3.5 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.5                       |4.3.6


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


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

* [Bug c/37985] [4.3/4.4/4.5/4.6 Regression] unsigned char shift lacks "statement with no effect" warning
  2008-11-01 10:55 [Bug c/37985] New: unsigned char shift lacks "statement with no effect" warning tkoenig at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2010-05-22 18:27 ` [Bug c/37985] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org
@ 2010-09-04 11:35 ` simartin at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: simartin at gcc dot gnu dot org @ 2010-09-04 11:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from simartin at gcc dot gnu dot org  2010-09-04 11:34 -------
This is due to
  http://gcc.gnu.org/ml/gcc-patches/2006-08/msg01041.html


-- 

simartin at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simartin at gcc dot gnu dot
                   |                            |org
   Last reconfirmed|2008-12-24 05:11:57         |2010-09-04 11:34:54
               date|                            |


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


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

end of thread, other threads:[~2010-09-04 11:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-01 10:55 [Bug c/37985] New: unsigned char shift lacks "statement with no effect" warning tkoenig at gcc dot gnu dot org
2008-11-01 12:50 ` [Bug c/37985] " rguenth at gcc dot gnu dot org
2009-03-30  1:38 ` tromey at gcc dot gnu dot org
2009-05-21 16:32 ` [Bug c/37985] [4.3/4.4/4.5 Regression] " tkoenig at gcc dot gnu dot org
2009-05-21 16:33 ` tkoenig at gcc dot gnu dot org
2009-05-23 11:42 ` tkoenig at gcc dot gnu dot org
2009-05-24 19:03 ` tkoenig at gcc dot gnu dot org
2009-05-28 14:43 ` rguenth at gcc dot gnu dot org
2009-08-04 12:43 ` rguenth at gcc dot gnu dot org
2010-05-22 18:27 ` [Bug c/37985] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org
2010-09-04 11:35 ` simartin 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).