public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/2454
@ 2002-07-10 18:26 sayle
  0 siblings, 0 replies; 8+ messages in thread
From: sayle @ 2002-07-10 18:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/2454; it has been noted by GNATS.

From: sayle@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c/2454
Date: 11 Jul 2002 01:23:08 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	sayle@gcc.gnu.org	2002-07-10 18:23:08
 
 Modified files:
 	gcc            : ChangeLog combine.c 
 
 Log message:
 	PR c/2454
 	* combine.c (nonzero_bits): LOAD_EXTEND_OP should only apply
 	to SUBREGs of MEMs.  (num_sign_bit_copies): Likewise.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.14818&r2=1.14819
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/combine.c.diff?cvsroot=gcc&r1=1.305&r2=1.306
 


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

* c/2454
@ 2003-04-28 10:16 jakub
  0 siblings, 0 replies; 8+ messages in thread
From: jakub @ 2003-04-28 10:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/2454; it has been noted by GNATS.

From: jakub@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c/2454
Date: 28 Apr 2003 10:07:15 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_2-rhl8-branch
 Changes by:	jakub@gcc.gnu.org	2003-04-28 10:07:14
 
 Modified files:
 	gcc            : ChangeLog combine.c 
 
 Log message:
 	PR c/2454
 	* combine.c (nonzero_bits): LOAD_EXTEND_OP should only apply
 	to SUBREGs of MEMs.  (num_sign_bit_copies): Likewise.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.13152.2.657.2.27.2.104&r2=1.13152.2.657.2.27.2.105
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/combine.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-rhl8-branch&r1=1.267.2.13.4.5&r2=1.267.2.13.4.6
 


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

* c/2454
@ 2003-01-25 16:06 ebotcazou
  0 siblings, 0 replies; 8+ messages in thread
From: ebotcazou @ 2003-01-25 16:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/2454; it has been noted by GNATS.

From: ebotcazou@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c/2454
Date: 25 Jan 2003 16:02:11 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_2-branch
 Changes by:	ebotcazou@gcc.gnu.org	2003-01-25 16:02:11
 
 Modified files:
 	gcc            : ChangeLog combine.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/gcc.c-torture/execute: 20030125-1.c 
 
 Log message:
 	PR optimization/9279
 	
 	Merge from mainline:
 	
 	2002-07-10  Roger Sayle  <roger@eyesopen.com>
 	
 	PR c/2454
 	* combine.c (nonzero_bits): LOAD_EXTEND_OP should only apply
 	to SUBREGs of MEMs.  (num_sign_bit_copies): Likewise.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.13152.2.657.2.187&r2=1.13152.2.657.2.188
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/combine.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.267.2.13.2.2&r2=1.267.2.13.2.3
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1672.2.166.2.82&r2=1.1672.2.166.2.83
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/20030125-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1
 


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

* c/2454
@ 2001-12-23 15:56 jsm28
  0 siblings, 0 replies; 8+ messages in thread
From: jsm28 @ 2001-12-23 15:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/2454; it has been noted by GNATS.

From: jsm28@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c/2454
Date: 23 Dec 2001 23:49:32 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	jsm28@gcc.gnu.org	2001-12-23 15:49:32
 
 Modified files:
 	gcc            : ChangeLog c-typeck.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/gcc.c-torture/execute: 20011223-1.c 
 
 Log message:
 	* c-typeck.c (c_start_case): Don't strip conversions from the
 	controlling expression.  Partially fixes PR c/2454.
 	
 	testsuite:
 	* gcc.c-torture/execute/20011223-1.c: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.12436&r2=1.12437
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&r1=1.161&r2=1.162
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.1491&r2=1.1492
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/20011223-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
 


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

* Re: c/2454
@ 2001-06-06 13:36 Joseph S. Myers
  0 siblings, 0 replies; 8+ messages in thread
From: Joseph S. Myers @ 2001-06-06 13:36 UTC (permalink / raw)
  To: jsm28; +Cc: gcc-prs

The following reply was made to PR c/2454; it has been noted by GNATS.

From: "Joseph S. Myers" <jsm28@cam.ac.uk>
To: Neil Booth <neil@daikokuya.demon.co.uk>
Cc: <gcc-gnats@gcc.gnu.org>,  <gcc-patches@gcc.gnu.org>
Subject: Re: c/2454
Date: Wed, 6 Jun 2001 21:32:12 +0100 (BST)

 On 6 Jun 2001, Neil Booth wrote:
 
 >  jsm28@gcc.gnu.org wrote:-
 >  
 >  >      Confirmed as a bug, and a regression from 2.95.  A small
 >  >      testcase is
 >  >      
 >  >      static int i;
 >  >      
 >  >      int
 >  >      main (void)
 >  >      {
 >  >        i = -1;
 >  >        switch((signed char) i) {
 >  >        case 255:
 >  >          abort ();
 >  >        default:
 >  >          exit (0);
 >  >        }
 >  >      }
 >  
 >  Ugh.  These signedness-of-less-than-int issues seem to be endless.
 
 This bug is more complicated than I'd hoped.  I think the patch below 
 addresses a C front end bug that is part of the problem - we shouldn't 
 strip type conversions from the switch case expression.  (2.95 did strip 
 them, but then gave a warning that the case value was out of range.  3.0 
 converts the case value, as required by the C standard - but the 
 conversion should be to the promoted type, int, not signed char.)  
 However, after this patch the testcase still fails with -O2, -Os, -O3.  
 Could someone familiar with the optimizers take a look at this?  This is a 
 regression, but not currently marked as "high".
 
 2001-06-06  Joseph S. Myers  <jsm28@cam.ac.uk>
 
 	* c-typeck.c (c_start_case): Don't strip conversions from the
 	controlling expression.  Partially fixes PR c/2454.
 
 2001-06-06  Joseph S. Myers  <jsm28@cam.ac.uk>
 
 	* gcc.c-torture/execute/20010606-1.c: New test.
 
 --- c-typeck.c.orig	Tue Jun  5 07:05:47 2001
 +++ c-typeck.c	Wed Jun  6 16:54:11 2001
 @@ -7044,7 +7044,6 @@
  	}
        else
  	{
 -	  tree index;
  	  type = TYPE_MAIN_VARIANT (TREE_TYPE (exp));
  
  	  if (warn_traditional && !in_system_header
 @@ -7054,14 +7053,6 @@
  
  	  exp = default_conversion (exp);
  	  type = TREE_TYPE (exp);
 -	  index = get_unwidened (exp, NULL_TREE);
 -	  /* We can't strip a conversion from a signed type to an
 -	     unsigned, because if we did, int_fits_type_p would do the
 -	     wrong thing when checking case values for being in range,
 -	     and it's too hard to do the right thing.  */
 -	  if (TREE_UNSIGNED (TREE_TYPE (exp))
 -	      == TREE_UNSIGNED (TREE_TYPE (index)))
 -	    exp = index;
  	}
      }
  
 --- testsuite/gcc.c-torture/execute/20010606-1.c	Mon Mar 26 23:57:02 2001
 +++ testsuite/gcc.c-torture/execute/20010606-1.c	Wed Jun  6 16:53:01 2001
 @@ -0,0 +1,22 @@
 +/* Origin: Joseph Myers <jsm28@cam.ac.uk>.  */
 +/* Case labels in a switch statement are converted to the promoted
 +   type of the controlling expression, not an unpromoted version.
 +   Reported as PR c/2454 by
 +   Andreas Krakowczyk <Andreas.Krakowczyk@fujitsu-siemens.com>.  */
 +
 +extern void exit (int);
 +extern void abort (void);
 +
 +static int i;
 +
 +int
 +main (void)
 +{
 +  i = -1;
 +  switch((signed char) i) {
 +  case 255:
 +    abort ();
 +  default:
 +    exit (0);
 +  }
 +}
 
 -- 
 Joseph S. Myers
 jsm28@cam.ac.uk
 


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

* Re: c/2454
@ 2001-06-06 13:26 Neil Booth
  0 siblings, 0 replies; 8+ messages in thread
From: Neil Booth @ 2001-06-06 13:26 UTC (permalink / raw)
  To: jsm28; +Cc: gcc-prs

The following reply was made to PR c/2454; it has been noted by GNATS.

From: Neil Booth <neil@daikokuya.demon.co.uk>
To: jsm28@gcc.gnu.org
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/2454
Date: Wed, 6 Jun 2001 21:16:44 +0100

 jsm28@gcc.gnu.org wrote:-
 
 >      Confirmed as a bug, and a regression from 2.95.  A small
 >      testcase is
 >      
 >      static int i;
 >      
 >      int
 >      main (void)
 >      {
 >        i = -1;
 >        switch((signed char) i) {
 >        case 255:
 >          abort ();
 >        default:
 >          exit (0);
 >        }
 >      }
 
 Ugh.  These signedness-of-less-than-int issues seem to be endless.
 
 Neil.


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

* Re: c/2454
@ 2001-06-06 10:06 jsm28
  0 siblings, 0 replies; 8+ messages in thread
From: jsm28 @ 2001-06-06 10:06 UTC (permalink / raw)
  To: jsm28; +Cc: gcc-prs

The following reply was made to PR c/2454; it has been noted by GNATS.

From: jsm28@gcc.gnu.org
To: jsm28@cam.ac.uk, Andreas.Krakowczyk@fujitsu-siemens.com,
  Erwin.Unruh@fujitsu-siemens.com, gcc-gnats@gcc.gnu.org, jsm28@gcc.gnu.org,
  nobody@gcc.gnu.org
Cc:  
Subject: Re: c/2454
Date: 6 Jun 2001 17:00:57 -0000

 Synopsis: Test Program A0376972.c fails with gcc-20010320, works with gcc-2.95.3
 
 Responsible-Changed-From-To: unassigned->jsm28
 Responsible-Changed-By: jsm28
 Responsible-Changed-When: Wed Jun  6 10:00:57 2001
 Responsible-Changed-Why:
     Patch in progress.
 State-Changed-From-To: feedback->analyzed
 State-Changed-By: jsm28
 State-Changed-When: Wed Jun  6 10:00:57 2001
 State-Changed-Why:
     Confirmed as a bug, and a regression from 2.95.  A small
     testcase is
     
     static int i;
     
     int
     main (void)
     {
       i = -1;
       switch((signed char) i) {
       case 255:
         abort ();
       default:
         exit (0);
       }
     }
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2454&database=gcc


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

* Re: c/2454
@ 2001-06-05 14:36 jsm28
  0 siblings, 0 replies; 8+ messages in thread
From: jsm28 @ 2001-06-05 14:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/2454; it has been noted by GNATS.

From: jsm28@gcc.gnu.org
To: jsm28@cam.ac.uk, Andreas.Krakowczyk@fujitsu-siemens.com,
  Erwin.Unruh@fujitsu-siemens.com, gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: c/2454
Date: 5 Jun 2001 21:26:56 -0000

 Synopsis: Test Program A0376972.c fails with gcc-20010320, works with gcc-2.95.3
 
 State-Changed-From-To: open->feedback
 State-Changed-By: jsm28
 State-Changed-When: Tue Jun  5 14:26:56 2001
 State-Changed-Why:
     The attachment to this PR seems to be empty; could you
     re-send it?
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2454&database=gcc


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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-10 18:26 c/2454 sayle
  -- strict thread matches above, loose matches on Subject: below --
2003-04-28 10:16 c/2454 jakub
2003-01-25 16:06 c/2454 ebotcazou
2001-12-23 15:56 c/2454 jsm28
2001-06-06 13:36 c/2454 Joseph S. Myers
2001-06-06 13:26 c/2454 Neil Booth
2001-06-06 10:06 c/2454 jsm28
2001-06-05 14:36 c/2454 jsm28

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).