Bug 41640 - [Regression] Compilation failure with "-g": bad assembler?
Summary: [Regression] Compilation failure with "-g": bad assembler?
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-09 07:26 UTC by Harald Anlauf
Modified: 2009-10-09 10:01 UTC (History)
1 user (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target:
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 Harald Anlauf 2009-10-09 07:26:21 UTC
Hi,

the following code fails to compile with Tobias Burnus' snapshot of trunk:

Character Function gfcbug89 (path)
  Character(len=*), Intent(in) :: path
  
  gfcbug89 = ""
  If (Len_Trim (path) < 1) Return
  gfcbug89 = path(1:1)   ! This assignment makes gfortran 4.5 error out

End Function gfcbug89

% gfc4x -g -c gfcbug89.f90
/tmp/ccmKoGIh.s: Assembler messages:
/tmp/ccmKoGIh.s:44: Error: unknown .loc sub-directive `discriminator'
/tmp/ccmKoGIh.s:44: Error: junk at end of line, first unrecognized character is `1'
% gfc4x -g -fbounds-check -c gfcbug89.f90
/tmp/ccMBdSjB.s: Assembler messages:
/tmp/ccMBdSjB.s:52: Error: unknown .loc sub-directive `discriminator'
/tmp/ccMBdSjB.s:52: Error: junk at end of line, first unrecognized character is `1'
/tmp/ccMBdSjB.s:56: Error: unknown .loc sub-directive `discriminator'
/tmp/ccMBdSjB.s:56: Error: junk at end of line, first unrecognized character is `1'
/tmp/ccMBdSjB.s:69: Error: unknown .loc sub-directive `discriminator'
/tmp/ccMBdSjB.s:69: Error: junk at end of line, first unrecognized character is `1'
% gfc4x --version
GNU Fortran (GCC) 4.5.0 20091008 (experimental) [trunk revision 152577]
[...]
% as --version
GNU assembler (GNU Binutils; openSUSE 11.0) 2.18.50.20080409-11.1
Copyright 2007 Free Software Foundation, Inc.
[...]
This assembler was configured for a target of `x86_64-suse-linux'.


I cannot read assembler for x86_64, but it appears that the lines 41-44
in the first case read:

	.loc 1 10 0
	testl	%eax, %eax
	jle	.L1
	.loc 1 10 0 is_stmt 0 discriminator 1

Any ideas?

Cheers,
-ha
Comment 1 Richard Biener 2009-10-09 09:53:38 UTC
Check why

gcc_GAS_CHECK_FEATURE([line table discriminator support],
 gcc_cv_as_discriminator,
 [2,19,51],,
[       .text
        .file 1 "conf.c"
        .loc 1 1 0 discriminator 1],,
[AC_DEFINE(HAVE_GAS_DISCRIMINATOR, 1,
  [Define if your assembler supports the .loc discriminator sub-directive.])])

says your gas supports this.
Comment 2 Andrew Pinski 2009-10-09 10:01:53 UTC
>says your gas supports this.

Easy this is a binary build with a newer binutils than you have.

So closing as invalid.