public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/35634]  New: [avr] result of char promotion comes out of CHAR_MIN/MAX
@ 2008-03-19  5:42 dmixm at marine dot febras dot ru
  2008-03-19  6:10 ` Andrew Pinski
                   ` (27 more replies)
  0 siblings, 28 replies; 29+ messages in thread
From: dmixm at marine dot febras dot ru @ 2008-03-19  5:42 UTC (permalink / raw)
  To: gcc-bugs

/* The next program is aborted with avr-gcc 4.1.2, 4.2.3, 4.3.0:
      result of char promotion comes out of CHAR_MIN/MAX.
   Options: -W -Wall -Os
   Know to work:
      3.3.6, 3.4.6 - good code
      4.0.4 - correct, but not the best
      4.1.2, 4.2.3, 4.3.0 - without optimization only
 */

#include <limits.h>

void abort (void);
void exit (int);

void foo (int i)
{
    static int n;
    if (i < CHAR_MIN || i > CHAR_MAX)
        abort ();
    if (++n > 1000)
        exit (0);
}

int main ()
{
    char c;
    for (c = 0; ; c++) foo (c);
}


-- 
           Summary: [avr] result of char promotion comes out of CHAR_MIN/MAX
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dmixm at marine dot febras dot ru


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


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

end of thread, other threads:[~2010-05-22 18:23 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-19  5:42 [Bug target/35634] New: [avr] result of char promotion comes out of CHAR_MIN/MAX dmixm at marine dot febras dot ru
2008-03-19  6:10 ` Andrew Pinski
2008-03-19  6:11 ` [Bug target/35634] " pinskia at gmail dot com
2008-03-19  7:08 ` pinskia at gcc dot gnu dot org
2008-03-19  9:57 ` schwab at suse dot de
2008-03-19 10:24 ` [Bug c/35634] " rguenth at gcc dot gnu dot org
2008-03-19 10:27 ` rguenth at gcc dot gnu dot org
2008-03-20 13:30 ` [Bug c/35634] [4.1/4.2/4.3/4.4 Regression] operand of pre-/postin-/decrement not promoted jsm28 at gcc dot gnu dot org
2008-03-20 13:40 ` rguenth at gcc dot gnu dot org
2008-03-20 13:42 ` rguenth at gcc dot gnu dot org
2008-03-20 17:56 ` rguenth at gcc dot gnu dot org
2008-03-26 13:16 ` jakub at gcc dot gnu dot org
2008-03-26 15:12 ` jsm28 at gcc dot gnu dot org
2008-04-09 14:33 ` jakub at gcc dot gnu dot org
2008-04-09 15:27 ` rguenther at suse dot de
2008-04-17 15:10 ` rguenth at gcc dot gnu dot org
2008-04-18 12:25 ` rguenth at gcc dot gnu dot org
2008-04-22 10:02 ` jakub at gcc dot gnu dot org
2008-07-04 22:41 ` [Bug c/35634] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2009-01-21 23:30 ` pinskia at gcc dot gnu dot org
2009-01-22 10:03 ` rguenth at gcc dot gnu dot org
2009-02-05  8:52 ` bonzini at gnu dot org
2009-03-31 20:49 ` [Bug c/35634] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
2009-04-11 15:59 ` rguenth at gcc dot gnu dot org
2009-04-11 16:30 ` joseph at codesourcery dot com
2009-04-11 16:33 ` rguenther at suse dot de
2009-04-13  8:20 ` rguenth at gcc dot gnu dot org
2009-08-04 12:51 ` rguenth at gcc dot gnu dot org
2010-05-22 18:23 ` [Bug c/35634] [4.3/4.4/4.5/4.6 " 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).