Bug 13620 - would be nice if gnatmake passed -fprofile-arcs to gnatlink
Summary: would be nice if gnatmake passed -fprofile-arcs to gnatlink
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 3.3.3
: P2 enhancement
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-08 23:26 UTC by Debian GCC Maintainers
Modified: 2004-04-05 15:00 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-01-09 00:03:10


Attachments
testcase (2.36 KB, application/x-gtar)
2004-01-08 23:27 UTC, Debian GCC Maintainers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Debian GCC Maintainers 2004-01-08 23:26:11 UTC
[forwarded from http://bugs.debian.org/226244]

seen with 3.3 CVS 20031229, works ok with 3.2.3, link error with head.

This is where I gave up on narrowing it down.

--*---*---*-
-*-*-*-*-*-*
------------
------------
------------
------------
-*-*-*-*-*-*
--*---*---*-

is what it should look like,

------*---*-
-*-*-*-*-*-*
------------
------------
------------
------------
-*-*-*-*-*-*
--*---*---*-

is what it looks like with -O3 -fprofile-arcs. As you can see from the
initalizer below, a gold basilisk is missing from the board. If I remove
the upper two layers that aren't being printed out, it stops
miscompiling.
Comment 1 Debian GCC Maintainers 2004-01-08 23:27:57 UTC
Created attachment 5438 [details]
testcase
Comment 2 Andrew Pinski 2004-01-09 00:03:09 UTC
Ada bugs will not be fixed for 3.3.3 but the link error on mainlin, I think, is caused by gnatmake 
not passing -fprofile-arcs to gcc when linking.
Comment 3 Laurent GUERBY 2004-01-10 11:31:11 UTC
A trivial workaround is to use "-largs -fprofile-arcs" when calling
gnatmake. The code generation bug is no longer present on mainline.

$ gnatls -v

GNATLS 3.4.0 20040105 (experimental) Copyright 1997-2004 Free Software
Foundation, Inc.

Source Search Path:
   <Current_Directory>
  
/home/guerby/work/gcc/install/install-20040105T165135/lib/gcc/i686-pc-linux-gnu/3.4.0/adainclude/


Object Search Path:
   <Current_Directory>
  
/home/guerby/work/gcc/install/install-20040105T165135/lib/gcc/i686-pc-linux-gnu/3.4.0/adalib/

$ gnatmake -f -O3 -fprofile-arcs drgnchss -largs -fprofile-arcs
gcc -c -O3 -fprofile-arcs drgnchss.adb
gcc -c -O3 -fprofile-arcs board_types.ads
gcc -c -O3 -fprofile-arcs print_board.adb
gnatbind -x drgnchss.ali
gnatlink drgnchss.ali -fprofile-arcs
$ ./drgnchss
--*---*---*-
-*-*-*-*-*-*
------------
------------
------------
------------
-*-*-*-*-*-*
--*---*---*-
Comment 4 Arnaud Charlet 2004-01-10 21:46:48 UTC
gnatmake not passing -fprofile-arcs is actually not a bug, but a
desirable enhancement.

Recategorizing accordingly.

Arno
Comment 5 David Starner 2004-01-12 10:55:22 UTC
(In reply to comment #4)
> gnatmake not passing -fprofile-arcs is actually not a bug, but a
> desirable enhancement.

If I pass valid arguments and valid code to gnatmake, and it fails to create
working code, how is that not a bug?
Comment 6 charlet 2004-01-12 10:59:45 UTC
Subject: Re:  would be nice if gnatmake passed -fprofile-arcs to gnatlink

> If I pass valid arguments and valid code to gnatmake, and it fails to create
> working code, how is that not a bug?

The above general statement is certainly true.

But in this case, you didn't pass valid arguments to gnatmake, since you
didn't pass -largs -fprofile-arcs.

Arno
Comment 7 David Starner 2004-01-12 11:02:30 UTC
Besides which, it's a regression. 

~/Code/Dragon_Chess/Bug/bug-226244 $ gnatmake -fprofile-arcs drgnchss.adb
gcc-3.3 -c -fprofile-arcs drgnchss.adb
gcc-3.3 -c -fprofile-arcs board_types.ads
gcc-3.3 -c -fprofile-arcs print_board.adb
gnatbind -x drgnchss.ali
gnatlink drgnchss.ali
~/Code/Dragon_Chess/Bug/bug-226244 $

It works just fine in previous versions.
Comment 8 charlet 2004-01-12 11:08:32 UTC
Subject: Re:  would be nice if gnatmake passed -fprofile-arcs to gnatlink

> Besides which, it's a regression.

In the strict sense, yes.

But the regression comes from the fact that -fprofile-arcs wasn't needed
before when calling gnatlink, so most likely a non Ada change caused this
'regression'.

Arno
Comment 9 CVS Commits 2004-04-05 14:58:20 UTC
Subject: Bug 13620

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	charlet@gcc.gnu.org	2004-04-05 14:57:46

Modified files:
	gcc/ada        : 5gmastop.adb adaint.c adaint.h a-except.adb 
	                 ali-util.adb eval_fat.adb eval_fat.ads 
	                 exp_ch6.adb g-curexc.ads gnatlink.adb 
	                 impunit.adb init.c make.adb Makefile.in 
	                 Makefile.rtl mlib-tgt.ads par-ch10.adb 
	                 par-ch3.adb par-ch4.adb par-ch6.adb scng.adb 
	                 sem_ch3.adb sem_ch4.adb sem_ch5.adb 
	                 sem_util.adb sem_warn.adb sinfo.ads 
	                 s-stoele.ads tbuild.adb tbuild.ads tracebak.c 
	                 ChangeLog 
Added files:
	gcc/ada        : a-dirval.ads a-dirval.adb 5vdirval.adb 
	                 5wdirval.adb a-direct.ads a-direct.adb 

Log message:
	2004-04-05  Vincent Celier  <celier@gnat.com>
	
	* adaint.h, adaint.c: Add function __gnat_named_file_length
	
	* impunit.adb: Add Ada.Directories to the list
	
	* Makefile.in: Add VMS and Windows versions of
	Ada.Directories.Validity package body.
	
	* Makefile.rtl: Add a-direct and a-dirval
	
	* mlib-tgt.ads: Minor comment update.
	
	* a-dirval.ads, a-dirval.adb, 5vdirval.adb, 5wdirval.adb,
	a-direct.ads, a-direct.adb: New files.
	
	2004-04-05  Vincent Celier  <celier@gnat.com>
	
	PR ada/13620
	* make.adb (Scan_Make_Arg): Pass any -fxxx switches to gnatlink, not
	just to the compiler.
	
	2004-04-05  Robert Dewar  <dewar@gnat.com>
	
	* a-except.adb (Exception_Name_Simple): Make sure lower bound of
	returned string is 1.
	
	* ali-util.adb: Use proper specific form for Warnings (Off, entity)
	
	* eval_fat.ads: Minor reformatting
	
	* g-curexc.ads: Document that lower bound of returned string values
	is always one.
	
	* gnatlink.adb: Add ??? comment for previous change
	(need to document why this is VMS specific)
	
	* s-stoele.ads: Minor reformatting
	
	* tbuild.ads: Minor reformatting throughout (new function specs)
	
	* par-ch10.adb (P_Context_Clause): Handle comma instead of semicolon
	after WITH.
	
	* scng.adb: Minor reformatting
	
	2004-04-05  Geert Bosch  <bosch@gnat.com>
	
	* eval_fat.adb (Machine): Remove unnecessary suppression of warning.
	(Leading_Part): Still perform truncation to machine number if the
	specified radix_digits is greater or equal to machine_mantissa.
	
	2004-04-05  Javier Miranda  <miranda@gnat.com>
	
	* par-ch3.adb: Complete documentation of previous change
	Correct wrong syntax documentation of the OBJECT_DECLARATION rule
	(aliased must appear before constant).
	
	* par-ch4.adb: Complete documentation of previous change.
	
	* par-ch6.adb: Complete documentation of previous change.
	
	* sinfo.ads: Fix typo in commment.
	
	2004-04-05  Ed Schonberg  <schonberg@gnat.com>
	
	* sem_ch3.adb (Inherit_Components): If derived type is private and has
	stored discriminants, use its discriminants to constrain parent type,
	as is done for non-private derived record types.
	
	* sem_ch4.adb (Remove_Abstract_Operations): New subprogram to implement
	Ada 2005 AI-310: an abstract non-dispatching operation is not a
	candidate interpretation in an overloaded call.
	
	* tbuild.adb (Unchecked_Convert_To): Preserve conversion node if
	expression is Null and target type is not an access type (e.g. a
	non-private address type).
	
	2004-04-05  Thomas Quinot  <quinot@act-europe.fr>
	
	* exp_ch6.adb (Rewrite_Function_Call): When rewriting an assignment
	statement whose right-hand side is an inlined call, save a copy of the
	original assignment subtree to preserve enough consistency for
	Analyze_Assignment to proceed.
	
	* sem_ch5.adb (Analyze_Assignment): Remove a costly copy of the
	complete assignment subtree which is now unnecessary, as the expansion
	of inlined call has been improved to preserve a consistent assignment
	tree.  Note_Possible_Modification must be called only
	after checks have been applied, or else unnecessary checks will
	be generated.
	
	* sem_util.adb (Note_Possible_Modification): Reorganise the handling
	of explicit dereferences that do not Come_From_Source:
	- be selective on cases where we must go back to the dereferenced
	pointer (an assignment to an implicit dereference must not be
	recorded as modifying the pointer);
	- do not rely on Original_Node being present (Analyze_Assignment
	calls Note_Possible_Modification on a copied tree).
	
	* sem_warn.adb (Check_References): When an unset reference to a pointer
	that is never assigned is encountered, prefer '<pointer> may be null'
	warning over '<pointer> is never assigned a value'.
	
	2004-04-05  Ramon Fernandez  <fernandez@gnat.com>
	
	* tracebak.c: Change STOP_FRAME in ppc vxworks to be compliant with
	the ABI.
	
	2004-04-05  Olivier Hainque  <hainque@act-europe.fr>
	
	* 5gmastop.adb (Pop_Frame): Comment out the pragma Linker_Option for
	libexc. We currently don't reference anything in this library and
	linking it in triggers linker warnings we don't want to see.
	
	* init.c: Update comments.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/a-dirval.ads.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/a-dirval.adb.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/5vdirval.adb.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/5wdirval.adb.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/a-direct.ads.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/a-direct.adb.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/5gmastop.adb.diff?cvsroot=gcc&r1=1.10&r2=1.11
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/adaint.c.diff?cvsroot=gcc&r1=1.28&r2=1.29
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/adaint.h.diff?cvsroot=gcc&r1=1.15&r2=1.16
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/a-except.adb.diff?cvsroot=gcc&r1=1.10&r2=1.11
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/ali-util.adb.diff?cvsroot=gcc&r1=1.9&r2=1.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/eval_fat.adb.diff?cvsroot=gcc&r1=1.6&r2=1.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/eval_fat.ads.diff?cvsroot=gcc&r1=1.6&r2=1.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/exp_ch6.adb.diff?cvsroot=gcc&r1=1.23&r2=1.24
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/g-curexc.ads.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/gnatlink.adb.diff?cvsroot=gcc&r1=1.17&r2=1.18
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/impunit.adb.diff?cvsroot=gcc&r1=1.11&r2=1.12
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/init.c.diff?cvsroot=gcc&r1=1.28&r2=1.29
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/make.adb.diff?cvsroot=gcc&r1=1.33&r2=1.34
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/Makefile.in.diff?cvsroot=gcc&r1=1.76&r2=1.77
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/Makefile.rtl.diff?cvsroot=gcc&r1=1.7&r2=1.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/mlib-tgt.ads.diff?cvsroot=gcc&r1=1.5&r2=1.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/par-ch10.adb.diff?cvsroot=gcc&r1=1.11&r2=1.12
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/par-ch3.adb.diff?cvsroot=gcc&r1=1.13&r2=1.14
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/par-ch4.adb.diff?cvsroot=gcc&r1=1.13&r2=1.14
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/par-ch6.adb.diff?cvsroot=gcc&r1=1.8&r2=1.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/scng.adb.diff?cvsroot=gcc&r1=1.4&r2=1.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/sem_ch3.adb.diff?cvsroot=gcc&r1=1.35&r2=1.36
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/sem_ch4.adb.diff?cvsroot=gcc&r1=1.15&r2=1.16
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/sem_ch5.adb.diff?cvsroot=gcc&r1=1.13&r2=1.14
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/sem_util.adb.diff?cvsroot=gcc&r1=1.24&r2=1.25
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/sem_warn.adb.diff?cvsroot=gcc&r1=1.12&r2=1.13
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/sinfo.ads.diff?cvsroot=gcc&r1=1.24&r2=1.25
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/s-stoele.ads.diff?cvsroot=gcc&r1=1.5&r2=1.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/tbuild.adb.diff?cvsroot=gcc&r1=1.7&r2=1.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/tbuild.ads.diff?cvsroot=gcc&r1=1.7&r2=1.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/tracebak.c.diff?cvsroot=gcc&r1=1.8&r2=1.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/ChangeLog.diff?cvsroot=gcc&r1=1.477&r2=1.478

Comment 10 Arnaud Charlet 2004-04-05 15:00:45 UTC
Fixed on mainline.

Arno