public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/32920]  New: error: type mismatch in binary expression
@ 2007-07-28  0:22 kristerw at gcc dot gnu dot org
  2007-07-28  0:25 ` [Bug middle-end/32920] [4.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: kristerw at gcc dot gnu dot org @ 2007-07-28  0:22 UTC (permalink / raw)
  To: gcc-bugs

Bootstrap (revision 126993 with gmp and mpfr in tree) fail with the error:

/gcctmp/gcc070727/build/./prev-gcc/xgcc -B/gcctmp/gcc070727/build/./prev-gcc/
-B/usr/local/i386-unknown-netbsdelf3.1/bin/ -DHAVE_CONFIG_H -I.
-I../../../gcc/gmp/printf -I.. -D__GMP_WITHIN_GMP -I../../../gcc/gmp -DNO_ASM
-g -O2 -fomit-frame-pointer -c ../../../gcc/gmp/printf/printffuns.c -o
printffuns.o
../../../gcc/gmp/printf/printffuns.c: In function 'gmp_fprintf_reps':
../../../gcc/gmp/printf/printffuns.c:56: error: type mismatch in binary
expression
unsigned int

int

unsigned int

D.4054 = MIN_EXPR <reps, 256>
../../../gcc/gmp/printf/printffuns.c:56: error: type mismatch in binary
expression
unsigned int

int

unsigned int

D.4055 = MIN_EXPR <i, 256>

> ./xgcc -B./ -v
Reading specs from ./specs
Target: i386-unknown-netbsdelf3.1
Configured with: ../gcc/configure --enable-languages=all,treelang,obj-c++
Thread model: posix
gcc version 4.3.0 20070727 (experimental)


A cut down example that reproduce the error:

#define MIN(l,o) ((l) < (o) ? (l) : (o))
int a;
void
foo(void)
{
  char buf[10];
  a = MIN(a, sizeof (buf));
}


-- 
           Summary: error: type mismatch in binary expression
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kristerw at gcc dot gnu dot org
 GCC build triplet: i386-unknown-netbsdelf3.1
  GCC host triplet: i386-unknown-netbsdelf3.1
GCC target triplet: i386-unknown-netbsdelf3.1


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


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

* [Bug middle-end/32920] [4.3 Regression] error: type mismatch in binary expression
  2007-07-28  0:22 [Bug c/32920] New: error: type mismatch in binary expression kristerw at gcc dot gnu dot org
@ 2007-07-28  0:25 ` pinskia at gcc dot gnu dot org
  2007-07-28 10:32 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-07-28  0:25 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|error: type mismatch in     |[4.3 Regression] error: type
                   |binary expression           |mismatch in binary
                   |                            |expression
   Target Milestone|---                         |4.3.0


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


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

* [Bug middle-end/32920] [4.3 Regression] error: type mismatch in binary expression
  2007-07-28  0:22 [Bug c/32920] New: error: type mismatch in binary expression kristerw at gcc dot gnu dot org
  2007-07-28  0:25 ` [Bug middle-end/32920] [4.3 Regression] " pinskia at gcc dot gnu dot org
@ 2007-07-28 10:32 ` rguenth at gcc dot gnu dot org
  2007-07-28 10:34 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-07-28 10:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2007-07-28 10:32 -------
Confirmed.  A bug in fold.


-- 

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         |2007-07-28 10:32:49
               date|                            |


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


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

* [Bug middle-end/32920] [4.3 Regression] error: type mismatch in binary expression
  2007-07-28  0:22 [Bug c/32920] New: error: type mismatch in binary expression kristerw at gcc dot gnu dot org
  2007-07-28  0:25 ` [Bug middle-end/32920] [4.3 Regression] " pinskia at gcc dot gnu dot org
  2007-07-28 10:32 ` rguenth at gcc dot gnu dot org
@ 2007-07-28 10:34 ` rguenth at gcc dot gnu dot org
  2007-07-28 16:13 ` cato at df dot lth dot se
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-07-28 10:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2007-07-28 10:33 -------
Created an attachment (id=13993)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13993&action=view)
patch

This patch fixes it.  It's ok for mainline if it passes a bootstrap & regtest.
It would be nice if someone could give it the cycles as I'm on vacation for the
next 3 weeks.  Thx.


-- 


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


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

* [Bug middle-end/32920] [4.3 Regression] error: type mismatch in binary expression
  2007-07-28  0:22 [Bug c/32920] New: error: type mismatch in binary expression kristerw at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-07-28 10:34 ` rguenth at gcc dot gnu dot org
@ 2007-07-28 16:13 ` cato at df dot lth dot se
  2007-07-28 16:27 ` kristerw at gcc dot gnu dot org
  2007-07-28 16:34 ` rguenth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cato at df dot lth dot se @ 2007-07-28 16:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from cato at df dot lth dot se  2007-07-28 16:13 -------
Subject: Re:  [4.3 Regression] error: type mismatch in
 binary expression


On Sat, 28 Jul 2007, rguenth at gcc dot gnu dot org wrote:

> This patch fixes it.  It's ok for mainline if it passes a bootstrap & regtest.
> It would be nice if someone could give it the cycles as I'm on vacation for the
> next 3 weeks.  Thx.

Bootstrapped and regtested on i386-unknown-netbsdelf3.1.

I'll commit it.

    /Krister


-- 


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


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

* [Bug middle-end/32920] [4.3 Regression] error: type mismatch in binary expression
  2007-07-28  0:22 [Bug c/32920] New: error: type mismatch in binary expression kristerw at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-07-28 16:13 ` cato at df dot lth dot se
@ 2007-07-28 16:27 ` kristerw at gcc dot gnu dot org
  2007-07-28 16:34 ` rguenth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: kristerw at gcc dot gnu dot org @ 2007-07-28 16:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from kristerw at gcc dot gnu dot org  2007-07-28 16:26 -------
Subject: Bug 32920

Author: kristerw
Date: Sat Jul 28 16:26:44 2007
New Revision: 127021

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127021
Log:
2007-07-28  Richard Guenther  <rguenther@suse.de>

        PR middle-end/32920
        * fold-const.c (fold_cond_expr_with_comparison): Convert
        operand zero of MIN/MAX_EXPR to correct type.

        * gcc.c-torture/compile/pr32920.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr32920.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/fold-const.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug middle-end/32920] [4.3 Regression] error: type mismatch in binary expression
  2007-07-28  0:22 [Bug c/32920] New: error: type mismatch in binary expression kristerw at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-07-28 16:27 ` kristerw at gcc dot gnu dot org
@ 2007-07-28 16:34 ` rguenth at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-07-28 16:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2007-07-28 16:33 -------
Thx!


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2007-07-28 16:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-28  0:22 [Bug c/32920] New: error: type mismatch in binary expression kristerw at gcc dot gnu dot org
2007-07-28  0:25 ` [Bug middle-end/32920] [4.3 Regression] " pinskia at gcc dot gnu dot org
2007-07-28 10:32 ` rguenth at gcc dot gnu dot org
2007-07-28 10:34 ` rguenth at gcc dot gnu dot org
2007-07-28 16:13 ` cato at df dot lth dot se
2007-07-28 16:27 ` kristerw at gcc dot gnu dot org
2007-07-28 16:34 ` 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).