[Bug target/107842] New: [avr] Set --param=min-pagesize=0 in the backend
gjl at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 23 17:33:43 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107842
Bug ID: 107842
Summary: [avr] Set --param=min-pagesize=0 in the backend
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: gjl at gcc dot gnu.org
Target Milestone: ---
The AVR backend should set --param=min-pagesize=0 in v12+, or otherwise we will
see warnings for each and every SFR access like:
typedef __UINT8_TYPE__ uint8_t;
#define SREG (*(volatile uint8_t*) (0x3F + __AVR_SFR_OFFSET__ ))
void bar (void)
{
SREG = 0;
}
> avr-gcc -c foo-i.c -mmcu=atmega8 -Os -Wall
foo-i.c: In function 'bar':
foo-i.c:7:6: warning: array subscript 0 is outside array bounds of 'volatile
uint8_t[0]' {aka 'volatile unsigned char[]'} [-Warray-bounds]
7 | SREG = 0;
| ~^~~~~~~~
More information about the Gcc-bugs
mailing list