This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Correct thinko (DECL_RTL to DECL_RTL_SET_P) in function.c


> > I propose the following patch. It is needed to build GNU Pascal,
> > otherwise GPC is unable to compile its runtime (the patch is
> > contained in the current release of GPC).
> 
> Do you have a testcase? We can't fix a bug on the 3.3 branch without it.
> 
> -- 
> Eric Botcazou
> 

1) GPC is a testcase. Below is simple program that makes GPC
crash. The crash is when making RTL for array `a1' (triggered by 
the DECL_RTL macro). IMHO GPC uses much more compilcated array 
declararions then other front ends (the code below is simple, but
GPC have to be prepared for more complex cases), so probably it is
not possible to reproduce the problem with other front end. 

{ Compile using -W flag. }
program String;

function MemCompCase (const s1; Size: SizeType): Boolean;
var
  i: Integer;
  a1: array [1 .. Size] of Char absolute s1;
begin
  MemCompCase := True
end;
begin
end.

The error message is:
 MemCompCase
string3.i: In function `MemCompCase':
string3.i:8: internal compiler error: in make_decl_rtl, at varasm.c:797
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

2) The codepath affected by the patch is active only when generating
extra warnings. So it is very unlikely that any other part depends on
this behavior. 

3) IMHO the patch is appropriate for gcc-3.3 -- it fixes real problem
for GPC and the chance of breaking something is very low. However if
inclusion in gcc-3.3 is against the policy that is fine. I developed
the patch a year ago and as I wrote it is currently distributed with 
GPC (so in full install Pascal uses patched backend and other front
ends use original backend). My objective here is to be able to build GPC
with unpatched backend, and that probably will happen only with 3.4. 

By the way, the patch applies to 3.4 snapshots. I bootstraped both 
gcc-3.3.2 and gcc-3.4-20031015 (ada build in gcc-3.4-20031029 failed 
for me) on i386 and run the testsuite. I saw no new regressions (compared
to unpatched build).
-- 
                              Waldek Hebisch
hebisch@math.uni.wroc.pl 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]