Optimization bug?

2015-09-19 Thread Sören Brinkmann
Hi, I recently came across some bug in my program that I could narrow down to the snipped below (also attached with a Makefile). extern unsigned int _vector_table; int main(void) { unsigned int *vector_base = &_vector_table; if (vector_base == 0) { return 1

Re: Optimization bug?

2015-09-19 Thread pinskia
> On Sep 19, 2015, at 11:00 AM, Sören Brinkmann > wrote: > > Hi, > > I recently came across some bug in my program that I could narrow down > to the snipped below (also attached with a Makefile). > > extern unsigned int _vector_table; You need the attribute weak here if the location of _ve

Re: Optimization bug?

2015-09-19 Thread Sören Brinkmann
Hi Andrew, On Sat, 2015-09-19 at 11:34AM -0700, pins...@gmail.com wrote: > > > > On Sep 19, 2015, at 11:00 AM, Sören Brinkmann > > wrote: > > > > Hi, > > > > I recently came across some bug in my program that I could narrow down > > to the snipped below (also attached with a Makefile). > >

Re: Optimization bug?

2015-09-19 Thread Martin Sebor
On 09/19/2015 03:32 PM, Sören Brinkmann wrote: Hi Andrew, On Sat, 2015-09-19 at 11:34AM -0700, pins...@gmail.com wrote: On Sep 19, 2015, at 11:00 AM, Sören Brinkmann wrote: Hi, I recently came across some bug in my program that I could narrow down to the snipped below (also attached with

Re: Optimization bug?

2015-09-19 Thread Richard Biener
On September 20, 2015 1:40:12 AM GMT+02:00, Martin Sebor wrote: >On 09/19/2015 03:32 PM, Sören Brinkmann wrote: >> Hi Andrew, >> >> On Sat, 2015-09-19 at 11:34AM -0700, pins...@gmail.com wrote: >>> >>> On Sep 19, 2015, at 11:00 AM, Sören Brinkmann > wrote: Hi, I recently