On Mon, 2012-11-12 at 20:57 +0100, Lluís Batlle i Rossell wrote:
> On Mon, Nov 12, 2012 at 06:53:46PM +0000, Brian Drummond wrote:
> > On Mon, 12 Nov 2012 17:47:47 +0100, you wrote:
> > 
> > >Just a short one, I forgot to mention, that it's obviously division
> > >expressions in the vhdl code (the (exp) below) that trigger the segfault.
> > >
> So, only very simple vhd files build fine for me with -O2.
> 
> Regards,
> Lluís.

I have started to look at this.

I have reduced the Unisims package to the following, which fails to
compile at -O2 with a Segfault.  If you comment out the TableType array,
the procedure compiles successfully!

Compiling as
ghdl -a -v -Q -O2 -fdump-tree-gimple unisim/testcase.vhd
there are differences between the generated Gimple files for the two
different optimisation levels. Which is interesting as I expected the
optimisations all happened later on.

I might restore the function-by-function dumping of Gimple format in
ortho-lang.c to see if the earliest generated Gimple has these
differences or not...

- Brian

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

LIBRARY STD;
USE STD.TEXTIO.ALL;

package VPKG is

    TYPE TableType IS ARRAY ( NATURAL RANGE <> ) OF Character;

  CONSTANT FDP_Q_tab : TableType := ( '0', '0' );

  procedure detect_resolution (
    constant model_name : in string
    );    
  
end VPKG;

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

package body VPKG is

  procedure detect_resolution (
    constant model_name : in string
    ) IS
    
    variable Message : LINE;
  BEGIN
      Write (Message, model_name);
      DEALLOCATE (Message);      
  END detect_resolution;      

end VPKG;

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


_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to