Re: [PATCH] aix: Default to DWARF 4

2021-01-18 Thread David Edelsohn via Gcc-patches
On Mon, Jan 18, 2021 at 11:49 AM Jakub Jelinek  wrote:
>
> On Mon, Jan 18, 2021 at 11:31:37AM -0500, David Edelsohn via Gcc-patches 
> wrote:
> > On Mon, Jan 18, 2021 at 6:01 AM Mark Wielaard  wrote:
> > >
> > > Hi David,
> > >
> > > On Sun, Jan 17, 2021 at 06:12:06PM -0500, David Edelsohn wrote:
> > > > GCC now defaults to DWARF 5.  AIX only supports DWARF 4 (3.5).
> > > >
> > > > This patch overrides the default DWARF version to 4 unless 
> > > > explicitly
> > > > stated.
> > > >
> > > > gcc/ChangeLog:
> > > >
> > > > * config/rs6000/aix71.h (SUBTARGET_OVERRIDE_OPTIONS): 
> > > > Override
> > > > dwarf_version to 4.
> > > > * config/rs6000/aix72.h (SUBTARGET_OVERRIDE_OPTIONS): Same.
> > >
> > > Thanks, I hadn't tested against AIX.  Could you also update
> > > gcc/doc/invoke.texi (-gdwarf) with the defaults for AIX?
> >
> > Other targets override the default DWARF level and I don't see it 
> > documented.
>
> We certainly document that Darwin and VxWorks default to dwarf_version 2.
> Which other targets do you have in mind?

s390 TPF.

- David


Re: [PATCH] aix: Default to DWARF 4

2021-01-18 Thread Mark Wielaard
Hi David,

On Mon, 2021-01-18 at 11:31 -0500, David Edelsohn wrote:
> On Mon, Jan 18, 2021 at 6:01 AM Mark Wielaard  wrote:
> > Thanks, I hadn't tested against AIX.  Could you also update
> > gcc/doc/invoke.texi (-gdwarf) with the defaults for AIX?
> 
> Other targets override the default DWARF level and I don't see it documented.

It currently says:

   @item -gdwarf
   @itemx -gdwarf-@var{version}
   @opindex gdwarf
   Produce debugging information in DWARF format (if that is
   supported).
   The value of @var{version} may be either 2, 3, 4 or 5; the default
   version for most targets is 5 (with the exception of VxWorks and
   Darwin/Mac OS X which default to version 2).

I don't know whether AIX really needs a special mention. But I think it
might be good to mention that it defaults to 4 instead of 5.

Cheers,

Mark


Re: [PATCH] aix: Default to DWARF 4

2021-01-18 Thread Jakub Jelinek via Gcc-patches
On Mon, Jan 18, 2021 at 11:31:37AM -0500, David Edelsohn via Gcc-patches wrote:
> On Mon, Jan 18, 2021 at 6:01 AM Mark Wielaard  wrote:
> >
> > Hi David,
> >
> > On Sun, Jan 17, 2021 at 06:12:06PM -0500, David Edelsohn wrote:
> > > GCC now defaults to DWARF 5.  AIX only supports DWARF 4 (3.5).
> > >
> > > This patch overrides the default DWARF version to 4 unless explicitly
> > > stated.
> > >
> > > gcc/ChangeLog:
> > >
> > > * config/rs6000/aix71.h (SUBTARGET_OVERRIDE_OPTIONS): Override
> > > dwarf_version to 4.
> > > * config/rs6000/aix72.h (SUBTARGET_OVERRIDE_OPTIONS): Same.
> >
> > Thanks, I hadn't tested against AIX.  Could you also update
> > gcc/doc/invoke.texi (-gdwarf) with the defaults for AIX?
> 
> Other targets override the default DWARF level and I don't see it documented.

We certainly document that Darwin and VxWorks default to dwarf_version 2.
Which other targets do you have in mind?

Jakub



Re: [PATCH] aix: Default to DWARF 4

2021-01-18 Thread David Edelsohn via Gcc-patches
On Mon, Jan 18, 2021 at 6:01 AM Mark Wielaard  wrote:
>
> Hi David,
>
> On Sun, Jan 17, 2021 at 06:12:06PM -0500, David Edelsohn wrote:
> > GCC now defaults to DWARF 5.  AIX only supports DWARF 4 (3.5).
> >
> > This patch overrides the default DWARF version to 4 unless explicitly
> > stated.
> >
> > gcc/ChangeLog:
> >
> > * config/rs6000/aix71.h (SUBTARGET_OVERRIDE_OPTIONS): Override
> > dwarf_version to 4.
> > * config/rs6000/aix72.h (SUBTARGET_OVERRIDE_OPTIONS): Same.
>
> Thanks, I hadn't tested against AIX.  Could you also update
> gcc/doc/invoke.texi (-gdwarf) with the defaults for AIX?

Other targets override the default DWARF level and I don't see it documented.

Thanks, David


Re: [PATCH] aix: Default to DWARF 4

2021-01-18 Thread Mark Wielaard
Hi David,

On Sun, Jan 17, 2021 at 06:12:06PM -0500, David Edelsohn wrote:
> GCC now defaults to DWARF 5.  AIX only supports DWARF 4 (3.5).
> 
> This patch overrides the default DWARF version to 4 unless explicitly
> stated.
> 
> gcc/ChangeLog:
> 
> * config/rs6000/aix71.h (SUBTARGET_OVERRIDE_OPTIONS): Override
> dwarf_version to 4.
> * config/rs6000/aix72.h (SUBTARGET_OVERRIDE_OPTIONS): Same.

Thanks, I hadn't tested against AIX.  Could you also update
gcc/doc/invoke.texi (-gdwarf) with the defaults for AIX?

Thanks,

Mark


[PATCH] aix: Default to DWARF 4

2021-01-17 Thread David Edelsohn via Gcc-patches
GCC now defaults to DWARF 5.  AIX only supports DWARF 4 (3.5).

This patch overrides the default DWARF version to 4 unless explicitly
stated.

gcc/ChangeLog:

* config/rs6000/aix71.h (SUBTARGET_OVERRIDE_OPTIONS): Override
dwarf_version to 4.
* config/rs6000/aix72.h (SUBTARGET_OVERRIDE_OPTIONS): Same.

diff --git a/gcc/config/rs6000/aix71.h b/gcc/config/rs6000/aix71.h
index cb250e9871c..3612ed2593b 100644
--- a/gcc/config/rs6000/aix71.h
+++ b/gcc/config/rs6000/aix71.h
@@ -62,6 +62,9 @@ do {
\
   /* aix/ppc doesn't support -mvsx and -maltivec with Go */
\
   rs6000_isa_flags &= ~(OPTION_MASK_VSX | OPTION_MASK_ALTIVEC);\
 }  \
+  if (!global_options_set.x_dwarf_version) \
+/* AIX only supports DWARF 4.  */  \
+dwarf_version = 4; \
 } while (0)

 #define ASM_SPEC32 "-a32"

diff --git a/gcc/config/rs6000/aix72.h b/gcc/config/rs6000/aix72.h
index 8bcaca47a7b..d34909283cc 100644
--- a/gcc/config/rs6000/aix72.h
+++ b/gcc/config/rs6000/aix72.h
@@ -62,6 +62,9 @@ do {
\
   /* aix/ppc doesn't support -mvsx and -maltivec with Go */
\
   rs6000_isa_flags &= ~(OPTION_MASK_VSX | OPTION_MASK_ALTIVEC);\
 }  \
+  if (!global_options_set.x_dwarf_version) \
+/* AIX only supports DWARF 4.  */  \
+dwarf_version = 4; \
 } while (0)

 #define ASM_SPEC32 "-a32"