Bug 38202 - [avr] FAIL: gcc.dg/torture/pr37868.c
Summary: [avr] FAIL: gcc.dg/torture/pr37868.c
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.5.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-20 16:13 UTC by Eric Weddington
Modified: 2010-01-29 16:43 UTC (History)
2 users (show)

See Also:
Host:
Target: avr-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Weddington 2008-11-20 16:13:58 UTC
New test gcc.dg/torture/pr37868.c fails for -O[0123s] with:

/usr/local/avrdev/gcc/gcc/gcc/testsuite/gcc.dg/torture/pr37868.c:8: error: width of 'a' exceeds its type

/usr/local/avrdev/gcc/gcc/gcc/testsuite/gcc.dg/torture/pr37868.c:9: error: width of 'b' exceeds its type


The test contains these declarations:
struct X {
  unsigned char pad : 4;
  unsigned int a : 32;
  unsigned int b : 24;
  unsigned int c : 6;
} __attribute__((packed));

An int on the AVR is 16-bits, hence the width of 'a' and 'b' exceed their type.
Comment 1 Eric Weddington 2008-11-20 16:14:52 UTC
Test was added by:

2008-11-20  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/37868
        * gcc.dg/torture/pr37868.c: New testcase.
        * gcc.c-torture/execute/pr38048-1.c: Likewise.
        * gcc.c-torture/execute/pr38048-2.c: Likewise.
Comment 2 abnikant 2009-08-06 11:13:54 UTC
gcc.dg/torture/pr37868.c should report the error..This is the positive test case for avr-gcc as the size of int = 16 bits,and in the struct X int bit field width is >16
Comment 3 Andy Hutchinson 2009-11-26 17:29:21 UTC
Fixed 4.5

Author: hutchinsonandy
Date: Mon Nov 23 22:21:21 2009
New Revision: 154474

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154474
Log:
* gcc.dg/torture/pr37868.c: Use smaller bitfield for 16bit int targets.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/torture/pr37868.c
Comment 4 Eric Weddington 2010-01-29 16:43:01 UTC
Changed Target Milestone.