public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/15549] New: true !< 'a'
@ 2004-05-21  4:30 flash at pobox dot com
  2004-05-21  5:59 ` [Bug c/15549] [3.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: flash at pobox dot com @ 2004-05-21  4:30 UTC (permalink / raw)
  To: gcc-bugs

static volatile bool arg1__Bool_1475 = true;
	volatile const static uint_least8_t arg2_char_1479 = 'a';
	printf(  " \t %s %d \n " , "" ,  arg1__Bool_1475 < arg2_char_1479  );
 

gives 0, not 1, on GNU C version 3.3 20030304 (Apple Computer, Inc. build 1495).
Originally found in C99 mode, but also with default flags.
gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-112.7.2) behaves as expected.
(The extra %s and empty string are for alignment issues on another platform.)



Commands:
gcc ../c/noerror/bugfiles/gcc_bool_bug.c

 a.out 
  1 < 97 ( arg1__Bool_1475 < arg2_char_1479 ) : 
          0 


Full source:

#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>


 int main()	{
//...
	static volatile bool arg1__Bool_1475 = true;
//...
	volatile const static uint_least8_t arg2_char_1479 = 'a';
	printf(  " %s %d" , "" , arg1__Bool_1475  );
	printf(  "%s < %d ( arg1__Bool_1475 < arg2_char_1479 ) : \n " , "" , arg2_char_1479  );
	printf(  " \t %s %d \n " , "" ,  arg1__Bool_1475 < arg2_char_1479  );
//...
	return 42;
}


Pre-processed file to follow, once I figure out how; here's the session:

gcc -v -save-temps ../c/noerror/bugfiles/gcc_bool_bug.c
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1495)
 /usr/libexec/gcc/darwin/ppc/3.3/cc1 -E -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=3 
-D__GNUC_PATCHLEVEL__=0 -D__APPLE_CC__=1495 -D__DYNAMIC__ ../c/noerror/bugfiles/
gcc_bool_bug.c -fPIC gcc_bool_bug.i
ignoring nonexistent directory "/usr/ppc-darwin/include"
ignoring nonexistent directory "/Local/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/include/gcc/darwin/3.3
 /usr/include
End of search list.
Framework search starts here:
 /System/Library/Frameworks
 /Library/Frameworks
End of framework search list.
 /usr/libexec/gcc/darwin/ppc/3.3/cc1 -fpreprocessed gcc_bool_bug.i -fPIC -quiet -dumpbase 
gcc_bool_bug.c -auxbase gcc_bool_bug -version -o gcc_bool_bug.s
GNU C version 3.3 20030304 (Apple Computer, Inc. build 1495) (ppc-darwin)
        compiled by GNU C version 3.3 20030304 (Apple Computer, Inc. build 1495).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=131072
 /usr/libexec/gcc/darwin/ppc/as -arch ppc -o gcc_bool_bug.o gcc_bool_bug.s
 ld -arch ppc -dynamic -o a.out -lcrt1.o -lcrt2.o -L/usr/lib/gcc/darwin/3.3 -L/usr/lib/gcc/darwin -L/
usr/libexec/gcc/darwin/ppc/3.3/../../.. gcc_bool_bug.o -lgcc -lSystem |
 c++filt3

-- 
           Summary: true !< 'a'
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: flash at pobox dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: ppc-darwin/3.3 20030304 (OSX 10.3.3)
  GCC host triplet: ppc-darwin/3.3 20030304 (OSX 10.3.3)
GCC target triplet: ppc-darwin/3.3 20030304 (OSX 10.3.3)


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


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

* [Bug c/15549] [3.3 Regression] true !< 'a'
  2004-05-21  4:30 [Bug c/15549] New: true !< 'a' flash at pobox dot com
@ 2004-05-21  5:59 ` pinskia at gcc dot gnu dot org
  2004-05-21  5:59 ` [Bug c/15549] " flash at pobox dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-21  5:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-20 05:09 -------
Confirmed, a regression from 2.95.3 for 3.3.x but not for 3.4.0 and 3.5.0.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
  GCC build triplet|ppc-darwin/3.3 20030304 (OSX|
                   |10.3.3)                     |
   GCC host triplet|ppc-darwin/3.3 20030304 (OSX|
                   |10.3.3)                     |
 GCC target triplet|ppc-darwin/3.3 20030304 (OSX|
                   |10.3.3)                     |
           Keywords|                            |wrong-code
      Known to fail|                            |3.0.4 3.2.3 3.3.3
      Known to work|                            |3.4.0 3.5.0 2.95.3
   Last reconfirmed|0000-00-00 00:00:00         |2004-05-20 05:09:22
               date|                            |
            Summary|true !< 'a'                 |[3.3 Regression] true !< 'a'
   Target Milestone|---                         |3.3.4


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


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

* [Bug c/15549] true !< 'a'
  2004-05-21  4:30 [Bug c/15549] New: true !< 'a' flash at pobox dot com
  2004-05-21  5:59 ` [Bug c/15549] [3.3 Regression] " pinskia at gcc dot gnu dot org
@ 2004-05-21  5:59 ` flash at pobox dot com
  2004-05-27 22:54 ` [Bug c/15549] [3.3 Regression] " falk at debian dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: flash at pobox dot com @ 2004-05-21  5:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From flash at pobox dot com  2004-05-20 04:56 -------
Created an attachment (id=6346)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6346&action=view)
Pre-processed source


-- 


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


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

* [Bug c/15549] [3.3 Regression] true !< 'a'
  2004-05-21  4:30 [Bug c/15549] New: true !< 'a' flash at pobox dot com
  2004-05-21  5:59 ` [Bug c/15549] [3.3 Regression] " pinskia at gcc dot gnu dot org
  2004-05-21  5:59 ` [Bug c/15549] " flash at pobox dot com
@ 2004-05-27 22:54 ` falk at debian dot org
  2004-06-01 15:52 ` zlomek at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: falk at debian dot org @ 2004-05-27 22:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From falk at debian dot org  2004-05-27 14:14 -------
Test case:

void abort(void);

__attribute__((noinline))
int lt (_Bool b, unsigned char c) { return b < c; } 

int main () { 
  if (!lt(1, 'a'))
    abort ();
} 

This is already broken in .00.rtl, which tries to do lt as (c != 0) & (b == 0),
which would be correct if c was also a bool.


-- 


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


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

* [Bug c/15549] [3.3 Regression] true !< 'a'
  2004-05-21  4:30 [Bug c/15549] New: true !< 'a' flash at pobox dot com
                   ` (2 preceding siblings ...)
  2004-05-27 22:54 ` [Bug c/15549] [3.3 Regression] " falk at debian dot org
@ 2004-06-01 15:52 ` zlomek at gcc dot gnu dot org
  2004-06-01 16:10 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: zlomek at gcc dot gnu dot org @ 2004-06-01 15:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zlomek at gcc dot gnu dot org  2004-06-01 15:52 -------
The following patch fixes the problem on mainline and 3.4 branch:

2003-08-19  Mark Mitchell  <mark@codesourcery.com>
        
        PR c++/11946
        * convert.c (convert_to_integer): Use CONVERT_EXPR (instead of             
        NOP_EXPR) when necessary.

http://gcc.gnu.org/ml/gcc-patches/2004-06/msg00055.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug c/15549] [3.3 Regression] true !< 'a'
  2004-05-21  4:30 [Bug c/15549] New: true !< 'a' flash at pobox dot com
                   ` (3 preceding siblings ...)
  2004-06-01 15:52 ` zlomek at gcc dot gnu dot org
@ 2004-06-01 16:10 ` cvs-commit at gcc dot gnu dot org
  2004-06-02  5:29 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-01 16:10 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-06-01 16:10 -------
Subject: Bug 15549

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	hammer-3_3-branch
Changes by:	zlomek@gcc.gnu.org	2004-06-01 16:10:10

Modified files:
	gcc            : ChangeLog.hammer convert.c 

Log message:
	PR c/15549
	Backport from mainline:
	
	2003-08-19  Mark Mitchell  <mark@codesourcery.com>
	
	PR c++/11946
	* convert.c (convert_to_integer): Use CONVERT_EXPR (instead of
	NOP_EXPR) when necessary.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.hammer.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.1.2.405&r2=1.1.2.406
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/convert.c.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.19.12.5&r2=1.19.12.6



-- 


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


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

* [Bug c/15549] [3.3 Regression] true !< 'a'
  2004-05-21  4:30 [Bug c/15549] New: true !< 'a' flash at pobox dot com
                   ` (4 preceding siblings ...)
  2004-06-01 16:10 ` cvs-commit at gcc dot gnu dot org
@ 2004-06-02  5:29 ` cvs-commit at gcc dot gnu dot org
  2004-06-11 22:21 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-02  5:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-06-02 05:29 -------
Subject: Bug 15549

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	hammer-3_3-branch
Changes by:	zlomek@gcc.gnu.org	2004-06-02 05:29:04

Modified files:
	gcc/testsuite  : ChangeLog.hammer 
	gcc/testsuite/gcc.dg: c99-bool-1.c 

Log message:
	PR c/15549
	Backport from mainline
	2003-08-19  Mark Mitchell  <mark@codesourcery.com>
	
	PR c++/11946.C
	* gcc.dg/c99-bool-1.c: Remove bogus warning.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.hammer.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.1.2.17&r2=1.1.2.18
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/c99-bool-1.c.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.3&r2=1.3.2.1



-- 


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


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

* [Bug c/15549] [3.3 Regression] true !< 'a'
  2004-05-21  4:30 [Bug c/15549] New: true !< 'a' flash at pobox dot com
                   ` (5 preceding siblings ...)
  2004-06-02  5:29 ` cvs-commit at gcc dot gnu dot org
@ 2004-06-11 22:21 ` pinskia at gcc dot gnu dot org
  2004-06-28  8:04 ` cvs-commit at gcc dot gnu dot org
  2004-08-31  3:45 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-11 22:21 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.3.4                       |3.3.5


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


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

* [Bug c/15549] [3.3 Regression] true !< 'a'
  2004-05-21  4:30 [Bug c/15549] New: true !< 'a' flash at pobox dot com
                   ` (6 preceding siblings ...)
  2004-06-11 22:21 ` pinskia at gcc dot gnu dot org
@ 2004-06-28  8:04 ` cvs-commit at gcc dot gnu dot org
  2004-08-31  3:45 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-28  8:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-06-28 08:03 -------
Subject: Bug 15549

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	zlomek@gcc.gnu.org	2004-06-28 08:03:48

Modified files:
	gcc            : ChangeLog convert.c 
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/gcc.dg: c99-bool-1.c 

Log message:
	PR c/15549
	Backport from mainline
	2003-08-19  Mark Mitchell  <mark@codesourcery.com>
	
	PR c++/11946
	* convert.c (convert_to_integer): Use CONVERT_EXPR (instead of
	NOP_EXPR) when necessary.
	
	PR c/15549
	Backport from mainline
	2003-08-19  Mark Mitchell  <mark@codesourcery.com>
	
	PR c++/11946.C
	* gcc.dg/c99-bool-1.c: Remove bogus warning.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.991&r2=1.16114.2.992
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/convert.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.19&r2=1.19.14.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.379&r2=1.2261.2.380
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/c99-bool-1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3&r2=1.3.4.1



-- 


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


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

* [Bug c/15549] [3.3 Regression] true !< 'a'
  2004-05-21  4:30 [Bug c/15549] New: true !< 'a' flash at pobox dot com
                   ` (7 preceding siblings ...)
  2004-06-28  8:04 ` cvs-commit at gcc dot gnu dot org
@ 2004-08-31  3:45 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-31  3:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-31 03:45 -------
Fixed.

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


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


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

end of thread, other threads:[~2004-08-31  3:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-21  4:30 [Bug c/15549] New: true !< 'a' flash at pobox dot com
2004-05-21  5:59 ` [Bug c/15549] [3.3 Regression] " pinskia at gcc dot gnu dot org
2004-05-21  5:59 ` [Bug c/15549] " flash at pobox dot com
2004-05-27 22:54 ` [Bug c/15549] [3.3 Regression] " falk at debian dot org
2004-06-01 15:52 ` zlomek at gcc dot gnu dot org
2004-06-01 16:10 ` cvs-commit at gcc dot gnu dot org
2004-06-02  5:29 ` cvs-commit at gcc dot gnu dot org
2004-06-11 22:21 ` pinskia at gcc dot gnu dot org
2004-06-28  8:04 ` cvs-commit at gcc dot gnu dot org
2004-08-31  3:45 ` pinskia 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).