[fpc-devel] Should the compiler work, if compiled with -Cr?

Martin lazarus at mfriebe.de
Sat Mar 16 17:12:17 CET 2013


On 16/03/2013 09:55, Jonas Maebe wrote:
>
> On 16 Mar 2013, at 02:35, Paul Ishenin wrote:
>
>> 16.03.13, 1:54, Martin wrote:
>>> revision 23848
>>>
>>> As reported recently:
>>>
>>> make clean
>>> make.exe all    LINKSMART=1  CREATESMART=1  DEBUG=1 OPTIMIZE=0 OPT="-gl
>>> -O2"
>>
>> No, it does not work.
>
> It definitely should work (there's even a special extcycle target in 
> the compiler Makefile to test it), and has worked mostly in the past. 
> It's not always checked and occasionally does get broken though.
>

The above "make" did not match my question. I have a batch and build 
several different configurations (mainly differ in debug related -gs/gw 
-O1/2 --- the -Cr was just for fun)

The -Cr make is

make clean
make.exe all LINKSMART=1  CREATESMART=1  DEBUG=1 OPTIMIZE=0 OPT="-gl -gw 
-godwarfsets -O-1 -Cr"

And started to crash a few weeks  (maybe few month) back.

I did never run the testcases for it. Only build it, and used it to 
build my tests.

--------------------------

The particular crash in question is by
   cstringpattern: AnsiString;
               len:=length(cstringpattern);
               recordtokenbuf.write(cstringpattern[1],len);
with a len of zero, writing 0 bytes from an address that is out of range.


Could be solved by using
  {$PUSH} {$R-}
  {$POP}
around those lines.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20130316/542be9cf/attachment.html>


More information about the fpc-devel mailing list