[Bug ada/97541] Ada failed to bootstrap: Error: file table slot 1 is already occupied by a different file

2021-07-31 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97541

H.J. Lu  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
   Host|https://sourceware.org/bugz |
   |illa/show_bug.cgi?id=26778  |
   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=26778
 Resolution|--- |MOVED

--- Comment #8 from H.J. Lu  ---
Moved.

[Bug ada/97541] Ada failed to bootstrap: Error: file table slot 1 is already occupied by a different file

2020-10-23 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97541

H.J. Lu  changed:

   What|Removed |Added

   Host||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=26778

--- Comment #7 from H.J. Lu  ---
I opened:

https://sourceware.org/bugzilla/show_bug.cgi?id=26778

[Bug ada/97541] Ada failed to bootstrap: Error: file table slot 1 is already occupied by a different file

2020-10-23 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97541

--- Comment #6 from Jakub Jelinek  ---
Created attachment 49432
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49432=edit
a-stzunb.s.xz

The assembly (though, I don't have binutils 2.35.1+ around, so can't verify
easily myself now).

[Bug ada/97541] Ada failed to bootstrap: Error: file table slot 1 is already occupied by a different file

2020-10-23 Thread mark at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97541

--- Comment #5 from Mark Wielaard  ---
(In reply to Jakub Jelinek from comment #4)
> # 82 "s-atocou.adb" 1
> isn't a .file assignment though.
> As I said earlier, if we don't want to revert the r11-3693 change and be
> able to specify -gdwarf-5 etc. to gas even when compiling files that contain
> explicit .debug_info from the compiler, then we need gas to act as if all
> that option affects is the version of the .debug_line emitted for explicit
> .file*/.loc* directives if present and nothing else (whenever the assembly
> contains manual
> .file*/.loc* directives or .debug_{info,line,...} sections).

That is the intention indeed, and I believe that is what binutils gas should be
doing. There used to be a bug where that didn't work for .file 1, but I thought
that was fixed upstream. Is this different from
https://sourceware.org/bugzilla/show_bug.cgi?id=26740

The assembly posted doesn't seem complete, what does ada really pass to gas?

>  So, basically,
> gas can start preparing for generation of its own .debug_* sections but
> should roll all that back when it sees .file/.loc directives or user
> .debug_{info,line} sections (perhaps some others).

Like I said above, that is the intention. So if it doesn't work like that it is
simply a bug in gas. It would be helpful to attach the preprocessed file that
ada generates to investigate what is really going on.

> Or, the other option is not to pass -gdwarf-5 to gas, but pass
> -gdwarf-line-version=5 or whatever other new option, which would only change
> the decision on if gas emits .debug_line section because of .file*/.loc*
> directives (and .debug_line is not present), what version of that to use.

That would be another option. But I like to first understand what is really
going on here.

[Bug ada/97541] Ada failed to bootstrap: Error: file table slot 1 is already occupied by a different file

2020-10-23 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97541

Jakub Jelinek  changed:

   What|Removed |Added

 CC|jakub at redhat dot com|mark at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek  ---
# 82 "s-atocou.adb" 1
isn't a .file assignment though.
As I said earlier, if we don't want to revert the r11-3693 change and be able
to specify -gdwarf-5 etc. to gas even when compiling files that contain
explicit .debug_info from the compiler, then we need gas to act as if all that
option affects is the version of the .debug_line emitted for explicit
.file*/.loc* directives if present and nothing else (whenever the assembly
contains manual
.file*/.loc* directives or .debug_{info,line,...} sections).  So, basically,
gas can start preparing for generation of its own .debug_* sections but should
roll all that back when it sees .file/.loc directives or user
.debug_{info,line} sections (perhaps some others).
Or, the other option is not to pass -gdwarf-5 to gas, but pass
-gdwarf-line-version=5 or whatever other new option, which would only change
the decision on if gas emits .debug_line section because of .file*/.loc*
directives (and .debug_line is not present), what version of that to use.

[Bug ada/97541] Ada failed to bootstrap: Error: file table slot 1 is already occupied by a different file

2020-10-23 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97541

--- Comment #3 from H.J. Lu  ---
(In reply to Jakub Jelinek from comment #2)
> So isn't that yet another thing that needs to be changed/fixed in gas?
> Plus on the gcc side add a test for that once it is fixed in binutils?

I think this is a GCC bug.  We can't assign the same file number to different
files:

# 82 "s-atocou.adb" 1
...
.file 1 "a-stzunb.adb"

This seems to be Ada specific.  I can't find a testcase in C nor C++.

[Bug ada/97541] Ada failed to bootstrap: Error: file table slot 1 is already occupied by a different file

2020-10-23 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97541

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
So isn't that yet another thing that needs to be changed/fixed in gas?
Plus on the gcc side add a test for that once it is fixed in binutils?

[Bug ada/97541] Ada failed to bootstrap: Error: file table slot 1 is already occupied by a different file

2020-10-23 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97541

H.J. Lu  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2020-10-23
 Status|UNCONFIRMED |NEW
 CC||jakub at redhat dot com

--- Comment #1 from H.J. Lu  ---
This is triggered by r11-3693:

commit 6923255e35a3d54f2083ad0f67edebb3f1b86506
Author: Jakub Jelinek 
Date:   Wed Oct 7 10:55:35 2020 +0200

debug: Pass --gdwarf-N to assembler if fixed gas is detected during
configure