public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking
@ 2024-01-04 13:02 yangyujie at loongson dot cn
  2024-01-04 13:06 ` [Bug target/113233] " yangyujie at loongson dot cn
                   ` (15 more replies)
  0 siblings, 16 replies; 18+ messages in thread
From: yangyujie at loongson dot cn @ 2024-01-04 13:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

            Bug ID: 113233
           Summary: LoongArch: target options from LTO objects not
                    respected during linking
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yangyujie at loongson dot cn
  Target Milestone: ---

Compiling LTO objects with certain target options like -march=, -msimd= have no
effect on the final linked binary, since COLLECT_GCC_OPTIONS from the "linker
GCC" driver always overrides these options.

For instance, running the following command:

$ gcc -S -o- -xc - -msimd=lasx  -O3 <<< "void m2 (float *a, int n) { for (int i
= 0; i < n; i++) a[i] += 1; }" | grep vfadd

outputs SIMD instructions (as enabled by -msimd=lasx):

        xvfadd.s        $xr4,$xr4,$xr0
        xvfadd.s        $xr2,$xr2,$xr0
        xvfadd.s        $xr1,$xr1,$xr0
        xvfadd.s        $xr3,$xr3,$xr0
        vfadd.s $vr1,$vr1,$vr0
        vfadd.s $vr1,$vr1,$vr0
        vfadd.s $vr1,$vr1,$vr0
        vfadd.s $vr1,$vr1,$vr0
        vfadd.s $vr1,$vr1,$vr0
        vfadd.s $vr1,$vr1,$vr0
        vfadd.s $vr0,$vr1,$vr0

However, LTO generates code according to the compiler's default config
(-msimd=none).

Running:
$ gcc -flto -c -o test.o -xc - -msimd=lasx -O3 <<< "void m2 (float *a, int n) {
for (int i = 0; i < n; i++) a[i] += 1; }"

and then:
$ gcc -S -o- -xlto test.o | grep vfadd

outputs nothing, indicating that the final code generation have LSX/LASX
disabled.

While:
$ gcc -S -o- -xlto test.o -mlasx | grep vfadd

outputs the same "vfadd" / "xvfadd" instructions as above.

-------------------------------------------------------------------------------------
Proposed solution: implement option save/restore to enable LTO option
streaming.
-------------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
@ 2024-01-04 13:06 ` yangyujie at loongson dot cn
  2024-01-04 13:31 ` xry111 at gcc dot gnu.org
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: yangyujie at loongson dot cn @ 2024-01-04 13:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

--- Comment #1 from Yang Yujie <yangyujie at loongson dot cn> ---
I've already made a patch for this, will push it to gcc-patches@gcc.gnu.org
later.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
  2024-01-04 13:06 ` [Bug target/113233] " yangyujie at loongson dot cn
@ 2024-01-04 13:31 ` xry111 at gcc dot gnu.org
  2024-01-04 13:49   ` Jan Hubicka
  2024-01-04 13:49 ` hubicka at ucw dot cz
                   ` (13 subsequent siblings)
  15 siblings, 1 reply; 18+ messages in thread
From: xry111 at gcc dot gnu.org @ 2024-01-04 13:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |loongarch*
   Last reconfirmed|                            |2024-01-04
                 CC|                            |xry111 at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Confirm.  But option save/restore has been always implemented:

    .section    .gnu.lto_.opts,"",@progbits
    .ascii  "'-fno-openmp' '-fno-openacc' '-fno-pie' '-fcf-protection"
    .ascii  "=none' '-mabi=lp64d' '-march=loongarch64' '-mfpu=64' '-m"
    .ascii  "simd=lasx' '-mcmodel=normal' '-mtune=loongarch64' '-flto"
    .ascii  "'\000"

So -msimd=lasx is correctly recorded.  Not sure why it does not work.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:31 ` xry111 at gcc dot gnu.org
@ 2024-01-04 13:49   ` Jan Hubicka
  0 siblings, 0 replies; 18+ messages in thread
From: Jan Hubicka @ 2024-01-04 13:49 UTC (permalink / raw)
  To: xry111 at gcc dot gnu.org; +Cc: gcc-bugs

> Confirm.  But option save/restore has been always implemented:
> 
>     .section    .gnu.lto_.opts,"",@progbits
>     .ascii  "'-fno-openmp' '-fno-openacc' '-fno-pie' '-fcf-protection"
>     .ascii  "=none' '-mabi=lp64d' '-march=loongarch64' '-mfpu=64' '-m"
>     .ascii  "simd=lasx' '-mcmodel=normal' '-mtune=loongarch64' '-flto"
>     .ascii  "'\000"
> 
> So -msimd=lasx is correctly recorded.  Not sure why it does not work.

With LTO we need to mix code compiled with different sets of options.
For this reason we imply for every function defition and optimization
and target attribute which record the flags.  So it seems target
attribute is likely broken for this flag.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
  2024-01-04 13:06 ` [Bug target/113233] " yangyujie at loongson dot cn
  2024-01-04 13:31 ` xry111 at gcc dot gnu.org
@ 2024-01-04 13:49 ` hubicka at ucw dot cz
  2024-01-04 13:51 ` xry111 at gcc dot gnu.org
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: hubicka at ucw dot cz @ 2024-01-04 13:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

--- Comment #3 from Jan Hubicka <hubicka at ucw dot cz> ---
> Confirm.  But option save/restore has been always implemented:
> 
>     .section    .gnu.lto_.opts,"",@progbits
>     .ascii  "'-fno-openmp' '-fno-openacc' '-fno-pie' '-fcf-protection"
>     .ascii  "=none' '-mabi=lp64d' '-march=loongarch64' '-mfpu=64' '-m"
>     .ascii  "simd=lasx' '-mcmodel=normal' '-mtune=loongarch64' '-flto"
>     .ascii  "'\000"
> 
> So -msimd=lasx is correctly recorded.  Not sure why it does not work.

With LTO we need to mix code compiled with different sets of options.
For this reason we imply for every function defition and optimization
and target attribute which record the flags.  So it seems target
attribute is likely broken for this flag.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
                   ` (2 preceding siblings ...)
  2024-01-04 13:49 ` hubicka at ucw dot cz
@ 2024-01-04 13:51 ` xry111 at gcc dot gnu.org
  2024-01-04 13:52 ` xry111 at gcc dot gnu.org
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: xry111 at gcc dot gnu.org @ 2024-01-04 13:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

--- Comment #4 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #3)
> > Confirm.  But option save/restore has been always implemented:
> > 
> >     .section    .gnu.lto_.opts,"",@progbits
> >     .ascii  "'-fno-openmp' '-fno-openacc' '-fno-pie' '-fcf-protection"
> >     .ascii  "=none' '-mabi=lp64d' '-march=loongarch64' '-mfpu=64' '-m"
> >     .ascii  "simd=lasx' '-mcmodel=normal' '-mtune=loongarch64' '-flto"
> >     .ascii  "'\000"
> > 
> > So -msimd=lasx is correctly recorded.  Not sure why it does not work.
> 
> With LTO we need to mix code compiled with different sets of options.
> For this reason we imply for every function defition and optimization
> and target attribute which record the flags.  So it seems target
> attribute is likely broken for this flag.

Target attribute is not implemented for LoongArch.  And I don't think it's a
good idea to implement it in stage 3.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
                   ` (3 preceding siblings ...)
  2024-01-04 13:51 ` xry111 at gcc dot gnu.org
@ 2024-01-04 13:52 ` xry111 at gcc dot gnu.org
  2024-01-05  1:31 ` yangyujie at loongson dot cn
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: xry111 at gcc dot gnu.org @ 2024-01-04 13:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

--- Comment #5 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Note that x86 also passes the recorded -mavx2 etc. to lto1.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
                   ` (4 preceding siblings ...)
  2024-01-04 13:52 ` xry111 at gcc dot gnu.org
@ 2024-01-05  1:31 ` yangyujie at loongson dot cn
  2024-01-11 11:04 ` cvs-commit at gcc dot gnu.org
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: yangyujie at loongson dot cn @ 2024-01-05  1:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

--- Comment #6 from Yang Yujie <yangyujie at loongson dot cn> ---
(In reply to Xi Ruoyao from comment #4)
> (In reply to Jan Hubicka from comment #3)
> > > Confirm.  But option save/restore has been always implemented:
> > > 
> > >     .section    .gnu.lto_.opts,"",@progbits
> > >     .ascii  "'-fno-openmp' '-fno-openacc' '-fno-pie' '-fcf-protection"
> > >     .ascii  "=none' '-mabi=lp64d' '-march=loongarch64' '-mfpu=64' '-m"
> > >     .ascii  "simd=lasx' '-mcmodel=normal' '-mtune=loongarch64' '-flto"
> > >     .ascii  "'\000"
> > > 
> > > So -msimd=lasx is correctly recorded.  Not sure why it does not work.
> > 
> > With LTO we need to mix code compiled with different sets of options.
> > For this reason we imply for every function defition and optimization
> > and target attribute which record the flags.  So it seems target
> > attribute is likely broken for this flag.
> 
> Target attribute is not implemented for LoongArch.  And I don't think it's a
> good idea to implement it in stage 3.

Yes, target attribute may have to wait.  But save/restore can be implemented
without target attributes of functions.  By marking options as "Save" in .opt
or implementing custom TARGET_OPTION_{SAVE,RESTORE} hooks, we can stream the
target configuration (which may come from the command line / the target
attributes / #pragma GCC target) into the per-function LTO bytecode, so that
lto1 can pick up and use them later when generating code for each function.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
                   ` (5 preceding siblings ...)
  2024-01-05  1:31 ` yangyujie at loongson dot cn
@ 2024-01-11 11:04 ` cvs-commit at gcc dot gnu.org
  2024-04-01  3:21 ` cvs-commit at gcc dot gnu.org
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-11 11:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by LuluCheng <chenglulu@gcc.gnu.org>:

https://gcc.gnu.org/g:ea2a9c76a1dcffbbec6e53655bef9236d3a8e691

commit r14-7134-gea2a9c76a1dcffbbec6e53655bef9236d3a8e691
Author: Yang Yujie <yangyujie@loongson.cn>
Date:   Thu Jan 11 09:07:10 2024 +0800

    LoongArch: Implement option save/restore

    LTO option streaming and target attributes both require per-function
    target configuration, which is achieved via option save/restore.

    We implement TARGET_OPTION_{SAVE,RESTORE} to switch the la_target
    context in addition to other automatically maintained option states
    (via the "Save" option property in the .opt files).

    Tested on loongarch64-linux-gnu without regression.

            PR target/113233

    gcc/ChangeLog:

            * config/loongarch/genopts/loongarch.opt.in: Mark options with
            the "Save" property.
            * config/loongarch/loongarch.opt: Same.
            * config/loongarch/loongarch-opts.cc: Refresh -mcmodel= state
            according to la_target.
            * config/loongarch/loongarch.cc: Implement TARGET_OPTION_{SAVE,
            RESTORE} for the la_target structure; Rename option conditions
            to have the same "la_" prefix.
            * config/loongarch/loongarch.h: Same.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
                   ` (6 preceding siblings ...)
  2024-01-11 11:04 ` cvs-commit at gcc dot gnu.org
@ 2024-04-01  3:21 ` cvs-commit at gcc dot gnu.org
  2024-04-01  3:23 ` cvs-commit at gcc dot gnu.org
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-01  3:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by LuluCheng
<chenglulu@gcc.gnu.org>:

https://gcc.gnu.org/g:4736b317047ae6b04f7609843f21cb68fef6a0c1

commit r13-8545-g4736b317047ae6b04f7609843f21cb68fef6a0c1
Author: Lulu Cheng <chenglulu@loongson.cn>
Date:   Fri Mar 15 16:23:05 2024 +0800

    LoongArch: gcc13: Implement option save/restore.

    LTO option streaming and target attributes both require per-function
    target configuration, which is achieved via option save/restore.

    We implement TARGET_OPTION_{SAVE,RESTORE} to switch the la_target
    context in addition to other automatically maintained option states
    (via the "Save" option property in the .opt files).

            PR target/113233

    gcc/ChangeLog:

            * config/loongarch/genopts/loongarch.opt.in: Mark options with
            the "Save" property.
            * config/loongarch/loongarch-opts.cc
            (loongarch_update_gcc_opt_status): Update the value of the
            la_target to global_options.
            * config/loongarch/loongarch-opts.h
            (loongarch_update_gcc_opt_status): Add a function declaration.
            * config/loongarch/loongarch.cc
            (loongarch_option_override_internal): Call the function
            loongarch_update_gcc_opt_status.
            (loongarch_option_save): New functions.
            (loongarch_option_restore): Likewise.
            (TARGET_OPTION_SAVE): Define macro.
            (TARGET_OPTION_RESTORE): Likewise.
            * config/loongarch/loongarch.opt: Regenerate.

    (cherry picked from commit ea2a9c76a1dcffbbec6e53655bef9236d3a8e691)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
                   ` (7 preceding siblings ...)
  2024-04-01  3:21 ` cvs-commit at gcc dot gnu.org
@ 2024-04-01  3:23 ` cvs-commit at gcc dot gnu.org
  2024-04-01  3:30 ` xry111 at gcc dot gnu.org
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-01  3:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by LuluCheng
<chenglulu@gcc.gnu.org>:

https://gcc.gnu.org/g:bf0b32d7929f8b4b15b21658d572b89ded03d8f8

commit r12-10303-gbf0b32d7929f8b4b15b21658d572b89ded03d8f8
Author: Lulu Cheng <chenglulu@loongson.cn>
Date:   Fri Mar 15 16:41:20 2024 +0800

    LoongArch: gcc12: Implement option save/restore.

    LTO option streaming and target attributes both require per-function
    target configuration, which is achieved via option save/restore.

    We implement TARGET_OPTION_{SAVE,RESTORE} to switch the la_target
    context in addition to other automatically maintained option states
    (via the "Save" option property in the .opt files).

            PR target/113233

    gcc/ChangeLog:

            * config/loongarch/genopts/loongarch.opt.in: Mark options with
            the "Save" property.
            * config/loongarch/loongarch-opts.cc
            (loongarch_update_gcc_opt_status): Update the value of the
            la_target to global_options.
            * config/loongarch/loongarch-opts.h
            (loongarch_update_gcc_opt_status): Add a function declaration.
            * config/loongarch/loongarch.cc
            (loongarch_option_override_internal): Call the function
            loongarch_update_gcc_opt_status.
            (loongarch_option_save): New functions.
            (loongarch_option_restore): Likewise.
            (TARGET_OPTION_SAVE): Define macro.
            (TARGET_OPTION_RESTORE): Likewise.
            * config/loongarch/loongarch.opt: Regenerate.

    (cherry picked from commit ea2a9c76a1dcffbbec6e53655bef9236d3a8e691)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
                   ` (8 preceding siblings ...)
  2024-04-01  3:23 ` cvs-commit at gcc dot gnu.org
@ 2024-04-01  3:30 ` xry111 at gcc dot gnu.org
  2024-04-07  8:37 ` xry111 at gcc dot gnu.org
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: xry111 at gcc dot gnu.org @ 2024-04-01  3:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.4
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #10 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
So fixed for all branches.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
                   ` (9 preceding siblings ...)
  2024-04-01  3:30 ` xry111 at gcc dot gnu.org
@ 2024-04-07  8:37 ` xry111 at gcc dot gnu.org
  2024-04-07  8:37 ` xry111 at gcc dot gnu.org
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: xry111 at gcc dot gnu.org @ 2024-04-07  8:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #11 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
I misunderstood the last change and this is not fixed:
https://gcc.gnu.org/pipermail/gcc-patches/2024-April/648921.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
                   ` (10 preceding siblings ...)
  2024-04-07  8:37 ` xry111 at gcc dot gnu.org
@ 2024-04-07  8:37 ` xry111 at gcc dot gnu.org
  2024-04-09  9:03 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: xry111 at gcc dot gnu.org @ 2024-04-07  8:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|12.4                        |---

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
                   ` (11 preceding siblings ...)
  2024-04-07  8:37 ` xry111 at gcc dot gnu.org
@ 2024-04-09  9:03 ` cvs-commit at gcc dot gnu.org
  2024-04-09 10:13 ` xry111 at gcc dot gnu.org
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-09  9:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by LuluCheng <chenglulu@gcc.gnu.org>:

https://gcc.gnu.org/g:8657d76d583f0f87000e9003ba75922f2bbe4455

commit r14-9866-g8657d76d583f0f87000e9003ba75922f2bbe4455
Author: Yang Yujie <yangyujie@loongson.cn>
Date:   Mon Apr 8 16:45:13 2024 +0800

    LoongArch: Enable switchable target

    This patch fixes the back-end context switching in cases where functions
    should be built with their own target contexts instead of the
    global one, such as LTO linking and functions with target attributes (TBD).

            PR target/113233

    gcc/ChangeLog:

            * config/loongarch/loongarch.cc (loongarch_reg_init):
            Reinitialize the loongarch_regno_mode_ok cache.
            (loongarch_option_override): Same.
            (loongarch_save_restore_target_globals): Restore target globals.
            (loongarch_set_current_function): Restore the target contexts
            for functions.
            (TARGET_SET_CURRENT_FUNCTION): Define.
            * config/loongarch/loongarch.h (SWITCHABLE_TARGET): Enable
            switchable target context.
            * config/loongarch/loongarch-builtins.cc (loongarch_init_builtins):
            Initialize all builtin functions at startup.
            (loongarch_expand_builtin): Turn assertion of builtin availability
            into a test.

    gcc/testsuite/ChangeLog:

            * lib/target-supports.exp: Define condition loongarch_sx_as.
            * gcc.dg/lto/pr113233_0.c: New test.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
                   ` (12 preceding siblings ...)
  2024-04-09  9:03 ` cvs-commit at gcc dot gnu.org
@ 2024-04-09 10:13 ` xry111 at gcc dot gnu.org
  2024-04-10  2:09 ` yangyujie at loongson dot cn
  2024-04-10  4:06 ` xry111 at gcc dot gnu.org
  15 siblings, 0 replies; 18+ messages in thread
From: xry111 at gcc dot gnu.org @ 2024-04-09 10:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

--- Comment #13 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Will we back port the fix to 13 and 12?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
                   ` (13 preceding siblings ...)
  2024-04-09 10:13 ` xry111 at gcc dot gnu.org
@ 2024-04-10  2:09 ` yangyujie at loongson dot cn
  2024-04-10  4:06 ` xry111 at gcc dot gnu.org
  15 siblings, 0 replies; 18+ messages in thread
From: yangyujie at loongson dot cn @ 2024-04-10  2:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

--- Comment #14 from Yang Yujie <yangyujie at loongson dot cn> ---
Is it not really necessary for now, since there is no LSX/LASX support in GCC
12 / 13?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug target/113233] LoongArch: target options from LTO objects not respected during linking
  2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
                   ` (14 preceding siblings ...)
  2024-04-10  2:09 ` yangyujie at loongson dot cn
@ 2024-04-10  4:06 ` xry111 at gcc dot gnu.org
  15 siblings, 0 replies; 18+ messages in thread
From: xry111 at gcc dot gnu.org @ 2024-04-10  4:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113233

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |14.0

--- Comment #15 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Yang Yujie from comment #14)
> Is it not really necessary for now, since there is no LSX/LASX support in
> GCC 12 / 13?

So closing the ticket as fixed.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-04-10  4:06 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-04 13:02 [Bug target/113233] New: LoongArch: target options from LTO objects not respected during linking yangyujie at loongson dot cn
2024-01-04 13:06 ` [Bug target/113233] " yangyujie at loongson dot cn
2024-01-04 13:31 ` xry111 at gcc dot gnu.org
2024-01-04 13:49   ` Jan Hubicka
2024-01-04 13:49 ` hubicka at ucw dot cz
2024-01-04 13:51 ` xry111 at gcc dot gnu.org
2024-01-04 13:52 ` xry111 at gcc dot gnu.org
2024-01-05  1:31 ` yangyujie at loongson dot cn
2024-01-11 11:04 ` cvs-commit at gcc dot gnu.org
2024-04-01  3:21 ` cvs-commit at gcc dot gnu.org
2024-04-01  3:23 ` cvs-commit at gcc dot gnu.org
2024-04-01  3:30 ` xry111 at gcc dot gnu.org
2024-04-07  8:37 ` xry111 at gcc dot gnu.org
2024-04-07  8:37 ` xry111 at gcc dot gnu.org
2024-04-09  9:03 ` cvs-commit at gcc dot gnu.org
2024-04-09 10:13 ` xry111 at gcc dot gnu.org
2024-04-10  2:09 ` yangyujie at loongson dot cn
2024-04-10  4:06 ` xry111 at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).