Bug 39631 - f951 seg faults while building libgfortran
Summary: f951 seg faults while building libgfortran
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2009-04-03 20:20 UTC by Steve Ellcey
Modified: 2009-04-12 18:43 UTC (History)
3 users (show)

See Also:
Host:
Target: hppa1.1-hp-hpux11.11
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Ellcey 2009-04-03 20:20:15 UTC
f951 generates a seg fault while building on hppa1.1-hp-hpux11.11.  It can be reproduced by compiling the following fortran code with -O2 optimization:

elemental function gfortran_specific_dim_r16 (p1, p2)
   real (kind=16), intent (in) :: p1, p2
   real (kind=16) :: gfortran_specific_dim_r16
   gfortran_specific_dim_r16 = dim (p1, p2)
end function

The segfault is coming from the ira_assert in ira_reuse_stack_slot at line 2966 of ira-color.c.  allocno is NULL but gets dereferenced in the ALLOCNO_HARD_REGNO macro.

It started failing sometime before r145385 and after r145268.  During that period the compiler was not building correctly on PA so I don't yet know exactly what change broke it.
Comment 1 Steve Ellcey 2009-04-03 21:18:44 UTC
Putting in a workaround to fix another build problem allowed me to track this problem down as starting with version r145309:

2009-03-30  Vladimir Makarov  <vmakarov@redhat.com>

        * reload.c (push_reload, find_dummy_reload): Use df_get_live_out
        instead of DF_LR_OUT.

        * ira-lives.c (process_bb_node_lives): Ditto.

        * ira-color.c (ira_loop_edge_freq): Use df_get_live_{out,in}
        instead of DF_LR_{OUT,IN}.

        * ira-emit.c (generate_edge_moves, add_ranges_and_copies): Ditto.

        * ira-build.c (create_bb_allocnos, create_loop_allocnos): Ditto.
Comment 2 H.J. Lu 2009-04-03 21:31:49 UTC
Can you try comment #3 in PR 39607?
Comment 3 Vladimir Makarov 2009-04-03 21:36:39 UTC
Steve, thanks for tracking it down. I did not reproduce the bug on x86-hppa cross compiler.  Therefore finding the patch is important to me.

This is not a single problem introduced by the patch.  Another one is PR39607.  Kenny pointed to me that IRA should use LIVE (not LR) info.  I had some doubts therefore I did not commit the patch before the 4.4 branch creation.  Now I see that the patch creates too many problems. So I am going to revert it.
Comment 4 Steve Ellcey 2009-04-03 21:40:10 UTC
> Can you try comment #3 in PR 39607?

I tried that change but it did not fix the problem.  Looks like Vladimir is
going to revert the entire patch.
Comment 5 hjl@gcc.gnu.org 2009-04-03 22:25:48 UTC
Subject: Bug 39631

Author: hjl
Date: Fri Apr  3 22:25:32 2009
New Revision: 145522

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145522
Log:
Mention

	PR rtl-optimization/39607
	PR rtl-optimization/39631

in ChangeLog for revision 145521.

Modified:
    trunk/gcc/ChangeLog

Comment 6 John David Anglin 2009-04-12 18:43:55 UTC
This is fixed in my builds.  Steve, if this is still a problem,
you can reopen.