Re: Compiler support for forbidding certain methods from being called

2025-04-15 Thread Julian Waters via Gcc
Hi Jonathan, Thanks for the suggestion, it seems promising. I switched out the error attribute for the warning attribute at first, since they should be equivalent except warning just warns instead of erroring. This results in the link step failing if LTO is enabled for some reason though. I then c

Re: Compiler support for forbidding certain methods from being called

2025-04-14 Thread Jonathan Wakely via Gcc
On Mon, 14 Apr 2025 at 14:47, Julian Waters wrote: > > Hi Jonathan, > > Thanks for the suggestion, it seems promising. I switched out the > error attribute for the warning attribute at first, since they should > be equivalent except warning just warns instead of erroring. This > results in the lin

Re: Compiler support for forbidding certain methods from being called

2025-04-14 Thread Jonathan Wakely via Gcc
On Mon, 14 Apr 2025 at 11:53, Julian Waters wrote: > > Hi Jonathan, > > Yep, unfortunately #pragma GCC poison is far too restrictive, it > doesn't check if it is a function call to that particular banned > function, it restricts any and all use of that identifier in the code > altogether. Not only

Re: Compiler support for forbidding certain methods from being called

2025-04-14 Thread Jonathan Wakely via Gcc
On Mon, 14 Apr 2025 at 12:57, Jonathan Wakely wrote: > > On Mon, 14 Apr 2025 at 11:53, Julian Waters wrote: > > > > Hi Jonathan, > > > > Yep, unfortunately #pragma GCC poison is far too restrictive, it > > doesn't check if it is a function call to that particular banned > > function, it restricts

Compiler support for forbidding certain methods from being called

2025-04-14 Thread Basile Starynkevitch
ng the whole process. > > It would be nice to have compiler support to help with this. I would recommend writing your GCC plugin which would add some problem specific pragmas. Some code from https://github.com/bstarynk/bismon might be improved (by you or your colleagues/interns) to fit into lat

Re: Compiler support for forbidding certain methods from being called

2025-04-14 Thread Julian Waters via Gcc
nctions. The crucial thing is that this mechanism must have a > > disable switch for when a callsite must actually call a forbidden > > function, complicating the whole process. > > > > It would be nice to have compiler support to help with this. Something like: > > >

Re: Compiler support for forbidding certain methods from being called

2025-04-14 Thread Jonathan Wakely via Gcc
callsite must actually call a forbidden > function, complicating the whole process. > > It would be nice to have compiler support to help with this. Something like: > > #pragma GCC forbidden void *malloc(size_t) // Forbids malloc from > being called anywhere Have you looked at

Compiler support for forbidding certain methods from being called

2025-04-14 Thread Julian Waters via Gcc
ement that. The problem is there's really no way at all to forbid standard library functions. The crucial thing is that this mechanism must have a disable switch for when a callsite must actually call a forbidden function, complicating the whole process. It would be nice to have compiler

Re: How to test Arm cross compiler?

2025-02-23 Thread Jeff Law via Gcc
o test the Arm cross compiler? Are there any documents? These days I'd be QEMU is the best approach if you don't have hardware. Not sure if there's any reasonable documentation on it. The embecosm folks might have suitable docs on their web page along with the dejagnu configurat

How to test Arm cross compiler?

2025-02-23 Thread Jan Dubiec via Gcc
To my surprise, I have just found out that Arm simulator has been deprecated: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=aec7815b4b78d4dcd2261f1dab1092dbf4a9e0be. Taking that into account what is the "official" way to test the Arm cross compiler? Are there any documents? /J.D.

Re: Request to Contribute to GNU Compiler Collection Project for GSoC Preparation

2024-11-26 Thread Martin Jambor
Hello, we are delighted you found contributing to GCC interesting. On Tue, Nov 19 2024, Vaibhav Arora via Gcc wrote: > Dear GNU Compiler Collection Team, > > I hope this email finds you well. My name is Vaibhav Arora, and I am an > enthusiastic software developer with a strong

Request to Contribute to GNU Compiler Collection Project for GSoC Preparation

2024-11-20 Thread Vaibhav Arora via Gcc
Dear GNU Compiler Collection Team, I hope this email finds you well. My name is Vaibhav Arora, and I am an enthusiastic software developer with a strong interest in contributing to open-source projects. I am writing to express my keen interest in GNU Compiler Collection, and to seek your

Cco gnu compiler

2024-10-31 Thread Revheim Liliam via Gcc
I am currently studying assembly language by kip Irvine and have ordered Sam R teah yourself C++ in 24 hours.. My route will include the most updated Java edition afterwards. I also need to update my computer, whoh is no longer supported, which computer should I get to accommodate your compiler

Re: How to debug/improve excessive compiler memory usage and compile times

2024-10-02 Thread Richard Biener via Gcc
2024 um 17:11 schrieb Matthias Kretz via Gcc : > > > > > > > > Hi, > > > > > > > > the unit tests are my long-standing pain point of > > > > excessive compiler memory usage and compile times. I've always worked > > > > around > >

Re: How to debug/improve excessive compiler memory usage and compile times

2024-10-02 Thread Richard Biener via Gcc
2024 um 17:11 schrieb Matthias Kretz via Gcc : > > > > > > > > Hi, > > > > > > > > the unit tests are my long-standing pain point of > > > > excessive compiler memory usage and compile times. I've always worked > > > > around > >

Re: How to debug/improve excessive compiler memory usage and compile times

2024-10-02 Thread Richard Biener via Gcc
On Wed, Oct 2, 2024 at 9:13 AM Richard Biener wrote: > > On Tue, Oct 1, 2024 at 6:06 PM Richard Biener > wrote: > > > > > > > > > Am 01.10.2024 um 17:11 schrieb Matthias Kretz via Gcc : > > > > > > Hi, > > > > > > the

Re: How to debug/improve excessive compiler memory usage and compile times

2024-10-02 Thread Andi Kleen via Gcc
Ben Boeckel via Gcc writes: > On Tue, Oct 01, 2024 at 18:06:35 +0200, Richard Biener via Gcc wrote: >> Analyze where the compile time is spent and where memory is spent. >> Identify unfitting data structures and algorithms causing the issue. >> Replace with better ones. That’s what I do for thes

Re: How to debug/improve excessive compiler memory usage and compile times

2024-10-02 Thread Richard Biener via Gcc
On Tue, Oct 1, 2024 at 6:06 PM Richard Biener wrote: > > > > > Am 01.10.2024 um 17:11 schrieb Matthias Kretz via Gcc : > > > > Hi, > > > > the unit tests are my long-standing pain point of > > excessive compiler memory usage and compile times. I

Re: How to debug/improve excessive compiler memory usage and compile times

2024-10-01 Thread Ben Boeckel via Gcc
On Tue, Oct 01, 2024 at 18:06:35 +0200, Richard Biener via Gcc wrote: > Analyze where the compile time is spent and where memory is spent. > Identify unfitting data structures and algorithms causing the issue. > Replace with better ones. That’s what I do for these kind of issues > in the middle en

Re: How to debug/improve excessive compiler memory usage and compile times

2024-10-01 Thread Richard Biener via Gcc
> Am 01.10.2024 um 17:11 schrieb Matthias Kretz via Gcc : > > Hi, > > the unit tests are my long-standing pain point of > excessive compiler memory usage and compile times. I've always worked around > the memory usage problem by splitting the test matrix into mul

How to debug/improve excessive compiler memory usage and compile times

2024-10-01 Thread Matthias Kretz via Gcc
Hi, the unit tests are my long-standing pain point of excessive compiler memory usage and compile times. I've always worked around the memory usage problem by splitting the test matrix into multiple translations (with different -D flags) of the same source file. I.e. pay with a huge n

Re: Is there a need to sometimes change gcc/config/t-* files when building a cross compiler?

2024-09-27 Thread Dennis Luehring via Gcc
Am 27.09.2024 um 13:00 schrieb Richard Earnshaw (lists): > It was very common at that time for suppliers to use slightly modified gcc sources for microcontrollers (especially ARM, but also for other targets).  Typically manufacturers and some major third-party gcc builders were ahead of mainli

Re: Is there a need to sometimes change gcc/config/t-* files when building a cross compiler?

2024-09-27 Thread Dennis Luehring via Gcc
Am 27.09.2024 um 11:03 schrieb David Brown: So there is a very real chance that the sources you have are not original. You could download the archived release from the gcc website and compare the sources to get some idea if they have changed. i do not have original source - only binaries, i ho

Re: Is there a need to sometimes change gcc/config/t-* files when building a cross compiler?

2024-09-27 Thread Richard Earnshaw (lists) via Gcc
> but that usage should be visible by using -v on the original build, or? >>> > >>> >>> I think so yes, but I'm not sure. If you said arm-elf in the mail Subject >>> you might get the attention of somebody who knows the details. >> >> so jus

Re: Is there a need to sometimes change gcc/config/t-* files when building a cross compiler?

2024-09-27 Thread David Brown via Gcc
t; but that usage should be visible by using -v on the original build, or? > I think so yes, but I'm not sure. If you said arm-elf in the mail Subject you might get the attention of somebody who knows the details. so just repost with a changed subject? Have you tried to obtain the so

Re: Is there a need to sometimes change gcc/config/t-* files when building a cross compiler?

2024-09-27 Thread Jonathan Wakely via Gcc
gcc-help@ list where questions like this belong. ARM maintainers will probably see it anyway. I've CC'd one of the ARM maintainers now too. Richard, can you answer the question from the first mail in the thread, regarding arm multilibs? (This is for gcc 3.4.0!) Can the original m

Re: Is there a need to sometimes change gcc/config/t-* files when building a cross compiler?

2024-09-27 Thread Dennis Luehring via Gcc
ginal build, or? > I think so yes, but I'm not sure. If you said arm-elf in the mail Subject you might get the attention of somebody who knows the details. so just repost with a changed subject? Have you tried to obtain the sources from whoever provided the original compiler that you

Re: Is there a need to sometimes change gcc/config/t-* files when building a cross compiler?

2024-09-27 Thread Jonathan Wakely via Gcc
7;m not sure. If you said arm-elf in the mail Subject you might get the attention of somebody who knows the details. Have you tried to obtain the sources from whoever provided the original compiler that you're trying to replicate?

Re: Is there a need to sometimes change gcc/config/t-* files when building a cross compiler?

2024-09-27 Thread Dennis Luehring via Gcc
content of my gcc-3.4.0\gcc\config\arm\t-arm-elf https://pastebin.com/CivYHhRa Am 27.09.2024 um 09:23 schrieb Dennis Luehring via Gcc: im currently trying to replicate a gcc-3.4.0 arm-elf build from an very old cross toolchain building with my script (https://pastebin.com/kAEK0S24) works but my

Re: Is there a need to sometimes change gcc/config/t-* files when building a cross compiler?

2024-09-27 Thread Jonathan Wakely via Gcc
On Fri, 27 Sept 2024, 08:24 Dennis Luehring via Gcc, wrote: > im currently trying to replicate a gcc-3.4.0 arm-elf build from an very > old cross toolchain > building with my script (https://pastebin.com/kAEK0S24) works > but my -print-multi-lib returns only > > --- > .; > thumb;@mthumb > --- > >

Re: Is there a need to sometimes change gcc/config/t-* files when building a cross compiler?

2024-09-27 Thread Dennis Luehring via Gcc
Am 27.09.2024 um 09:34 schrieb Jonathan Wakely: They might not have been using the original gcc-3.4.0 sources. seems to be very possible There should be no need to edit those files, but that doesn't mean that the people who built your old toolchain didn't edit them. the other way would

Is there a need to sometimes change gcc/config/t-* files when building a cross compiler?

2024-09-27 Thread Dennis Luehring via Gcc
im currently trying to replicate a gcc-3.4.0 arm-elf build from an very old cross toolchain building with my script (https://pastebin.com/kAEK0S24) works but my -print-multi-lib returns only --- .; thumb;@mthumb --- the original builds -print-multi-lib returns --- .; thumb;@mthumb be;@mbig-endi

Want to get a programming language compiler :)

2024-09-20 Thread Aimaan Khan via Gcc
Yea, am just wanna make a compiler for my programming language (because it is VERY NEW and the good reason is that IT IS COMPILED) and because it is compiled i need a compiler for my programming language, There are not many features in it BUT i will be adding stuff to it. The programming

The codeblocks which I installed is not compiling the program so guid me How to install a c compiler to codeblocks

2023-12-18 Thread Shivaprasad M S via Gcc

Re: There Might a Bug in the Compiler: When Calling Weak Defined Function

2023-08-07 Thread Andrew Pinski via Gcc
On Mon, Aug 7, 2023 at 8:52 AM Şahin Duran via Gcc wrote: > > Dear GCC Developers, > > I think I've just discovered a bug/ undefined situation in the compiler. > When I try to call a weakly defined function, compiler successfully > generates the code of calling procedure

Re: There Might a Bug in the Compiler: When Calling Weak Defined Function

2023-08-07 Thread Richard Earnshaw (lists) via Gcc
On 07/08/2023 16:51, Şahin Duran via Gcc wrote: Dear GCC Developers, I think I've just discovered a bug/ undefined situation in the compiler. When I try to call a weakly defined function, compiler successfully generates the code of calling procedure. However, this calling procedure is no

There Might a Bug in the Compiler: When Calling Weak Defined Function

2023-08-07 Thread Şahin Duran via Gcc
Dear GCC Developers, I think I've just discovered a bug/ undefined situation in the compiler. When I try to call a weakly defined function, compiler successfully generates the code of calling procedure. However, this calling procedure is nothing but branching to address 0 which resul

Re: /home/toon/compilers/gcc/libgfortran/generated/matmul_i1.c:1781:1: internal compiler error: RTL check: expected elt 0 type 'i' or 'n', have 'w' (rtx const_int) in vpternlog_redundant_operand_mask,

2023-08-06 Thread Andrew Pinski via Gcc
gi?id=110926 . Thanks, Andrew > > > > > > > > To quote: > > > > > > > > during RTL pass: split1 > > > > /home/toon/compilers/gcc/libgfortran/generated/matmul_i1.c: In function > > > > 'matmul_i1_avx512f&

Re: /home/toon/compilers/gcc/libgfortran/generated/matmul_i1.c:1781:1: internal compiler error: RTL check: expected elt 0 type 'i' or 'n', have 'w' (rtx const_int) in vpternlog_redundant_operand_mask,

2023-08-06 Thread Hongtao Liu via Gcc
> 'matmul_i1_avx512f': > > > /home/toon/compilers/gcc/libgfortran/generated/matmul_i1.c:1781:1: > > > internal compiler error: RTL check: expected elt 0 type 'i' or 'n', have > > > 'w' (rtx const_int) in vpternlog_redundant_operand_m

Re: /home/toon/compilers/gcc/libgfortran/generated/matmul_i1.c:1781:1: internal compiler error: RTL check: expected elt 0 type 'i' or 'n', have 'w' (rtx const_int) in vpternlog_redundant_operand_mask,

2023-08-06 Thread Hongtao Liu via Gcc
I guess --enable-checking=yes,rtl,extra is key to reproduce the issue? > > > > To quote: > > > > during RTL pass: split1 > > /home/toon/compilers/gcc/libgfortran/generated/matmul_i1.c: In function > > 'matmul_i1_avx512f': > > /home/toon/compil

Re: /home/toon/compilers/gcc/libgfortran/generated/matmul_i1.c:1781:1: internal compiler error: RTL check: expected elt 0 type 'i' or 'n', have 'w' (rtx const_int) in vpternlog_redundant_operand_mask,

2023-08-06 Thread Hongtao Liu via Gcc
ed/matmul_i1.c: In function > 'matmul_i1_avx512f': > /home/toon/compilers/gcc/libgfortran/generated/matmul_i1.c:1781:1: > internal compiler error: RTL check: expected elt 0 type 'i' or 'n', have > 'w' (rtx const_int) in vpternlog_redundant_operand_mask, at

/home/toon/compilers/gcc/libgfortran/generated/matmul_i1.c:1781:1: internal compiler error: RTL check: expected elt 0 type 'i' or 'n', have 'w' (rtx const_int) in vpternlog_redundant_operand_mask, at

2023-08-06 Thread Toon Moene
/generated/matmul_i1.c:1781:1: internal compiler error: RTL check: expected elt 0 type 'i' or 'n', have 'w' (rtx const_int) in vpternlog_redundant_operand_mask, at config/i386/i386.cc:19460 1781 | } | ^ during RTL pass: split1 /home/toon/compilers/gcc/libgfo

Interesting a binary regression search into the compiler

2023-05-13 Thread Thomas Koenig via Gcc
Hi, I'm not sure who on this mailing list reads comp.compilers, but there is an interesting article about built-in regression search in the go compiler at https://compilers.iecc.com/comparch/article/23-05-003 . Using a similar approach could also be interesting for gcc, complementing tools

Where is the libtool compiler lib search path generated from?

2023-05-07 Thread Julian Waters via Gcc
Currently I have a libtool that looks something like this: # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path="-LD:/Eclipse/Workspace/MINGW-packages/mingw-w64-gcc/src/build-UCRT64/x86_64-w64-mingw32/libstdc++-v3/src -LD:/Ec

Why spill_failure() aborts the compiler when hard-registers cannot find to spill pseudo-registers?

2023-04-24 Thread 花井志生 via Gcc
I am curious why spill_failure() in gcc/reload1.cc aborts the compiler. static void spill_failure (rtx_insn *insn, enum reg_class rclass) { if (asm_noperands (PATTERN (insn)) >= 0) error_for_asm (insn, "cannot find a register in class %qs while " "reloading %",

Re: [GSOC] query about C++: Implement compiler built-in traits for the standard library traits

2023-03-31 Thread Martin Jambor
gt; >> > On Mon, Mar 20 2023, Anastasia3412 via Gcc wrote: >> > >> > > Hello Everyone I'm Anastasia. >> > > >> > > I am a prospective GSOC Student. I wish to know if the project C++: >> > > Implement compiler built-in traits for the

[GSoC] C++: Compiler Built-in Traits

2023-03-27 Thread Ken Matsui via Gcc
Hi, I am Ken, an undergraduate student majoring in Computer Science and minoring in Linguistics (because of my interest in syntax from both natural and programming languages prospectives) at University of Washington, Seattle. I am interested in the GSoC project: C++: Implement compiler built-in

Re: [GSOC] query about C++: Implement compiler built-in traits for the standard library traits

2023-03-22 Thread Anastasia3412 via Gcc
ery happy that you are considering contributing to GCC. > > > > On Mon, Mar 20 2023, Anastasia3412 via Gcc wrote: > > > > > Hello Everyone I'm Anastasia. > > > > > > I am a prospective GSOC Student. I wish to know if the project C++: > > > Implem

Re: [GSOC] query about C++: Implement compiler built-in traits for the standard library traits

2023-03-21 Thread Jonathan Wakely via Gcc
OC Student. I wish to know if the project C++: > >Implement compiler built-in traits for the standard library traits is > >still available. I have already build and got my hand dirty on > >debugging GCC. > > Various prospective contributors have shown interest in it but we h

Re: [GSOC] query about C++: Implement compiler built-in traits for the standard library traits

2023-03-21 Thread Martin Jambor
Hello Anastasia, we are very happy that you are considering contributing to GCC. On Mon, Mar 20 2023, Anastasia3412 via Gcc wrote: > Hello Everyone I'm Anastasia. > >I am a prospective GSOC Student. I wish to know if the project C++: >Implement compiler built-in traits for the

[GSOC] query about C++: Implement compiler built-in traits for the standard library traits

2023-03-20 Thread Anastasia3412 via Gcc
Hello Everyone I'm Anastasia. I am a prospective GSOC Student. I wish to know if the project C++: Implement compiler built-in traits for the standard library traits is still available. I have already build and got my hand dirty on debugging GCC. How should I proceed to make a proposal. A

Re: [GSoC][C++: Compiler Built-in Traits]: Example Impls & Small Patches

2023-02-28 Thread Patrick Palka via Gcc
Hi Ken, On Mon, Feb 27, 2023 at 5:02 PM Ken Matsui via Gcc wrote: > > Hi, > > My name is Ken Matsui. I am highly interested in contributing to the > project idea, "C++: Implement compiler built-in traits for the > standard library traits." To understand how to impleme

Re: [GSoC][C++: Implement compiler built-in traits for the standard library traits]

2023-02-28 Thread Jonathan Wakely via Gcc
On Tue, 28 Feb 2023 at 10:58, Berke Yavas via Gcc wrote: > > Hi, > > I am Berke. I am interested in the project C++: Implement compiler built-in > traits for the standard library traits for the upcoming GSoC. I am a > Software Engineer with a year of experience. I am very

[GSoC][C++: Implement compiler built-in traits for the standard library traits]

2023-02-28 Thread Berke Yavas via Gcc
Hi, I am Berke. I am interested in the project C++: Implement compiler built-in traits for the standard library traits for the upcoming GSoC. I am a Software Engineer with a year of experience. I am very excited to have a chance to work on gcc. So far, I have built gcc from source, runned tests

[GSoC][C++: Compiler Built-in Traits]: Example Impls & Small Patches

2023-02-27 Thread Ken Matsui via Gcc
Hi, My name is Ken Matsui. I am highly interested in contributing to the project idea, "C++: Implement compiler built-in traits for the standard library traits." To understand how to implement those traits, could you please give me some example implementations of the compiler built-in

[GSoC][C++: Compiler Built-in Traits]: Example Impls & Small Patches

2023-02-24 Thread Ken Matsui via Gcc
Hi, My name is Ken Matsui. I am highly interested in contributing to the project idea, "C++: Implement compiler built-in traits for the standard library traits." To understand how to implement those traits, could you please give me some example implementations of the compiler built-in

Re: msp430-elf cross-compiler: libstdc++ supported?

2022-11-08 Thread Jonathan Wakely via Gcc
On Tue, 8 Nov 2022 at 12:37, Jonathan Wakely wrote: > > On Tue, 8 Nov 2022 at 11:22, Florian Weimer via Libstdc++ > wrote: > > > > I'm trying to validate a change to gcc/config/msp430/msp430.cc. > > The cross-compiler builds as far as I can tell, but I hit a sn

Re: msp430-elf cross-compiler: libstdc++ supported?

2022-11-08 Thread Jonathan Wakely via Gcc
On Tue, 8 Nov 2022 at 11:22, Florian Weimer via Libstdc++ wrote: > > I'm trying to validate a change to gcc/config/msp430/msp430.cc. > The cross-compiler builds as far as I can tell, but I hit a snag while > configuring libstdc++: > > checking for shl_load... configure: er

msp430-elf cross-compiler: libstdc++ supported?

2022-11-08 Thread Florian Weimer via Gcc
I'm trying to validate a change to gcc/config/msp430/msp430.cc. The cross-compiler builds as far as I can tell, but I hit a snag while configuring libstdc++: checking for shl_load... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES. make[1]: *** [Makefile:12334: conf

Re: Building gcc 12 cross-compiler with --enable-lto on FreeBSD fails

2022-06-15 Thread Chris Johns
On 15/6/22 7:56 pm, Richard Biener wrote: > On Wed, Jun 15, 2022 at 11:27 AM Chris Johns > wrote: >> >> Hi, >> >> I am trying to build a cross-compiler on FreeBSD with --enable-lto because a >> chip vendor is using it when building controller software tha

Re: Building gcc 12 cross-compiler with --enable-lto on FreeBSD fails

2022-06-15 Thread Richard Biener via Gcc
On Wed, Jun 15, 2022 at 11:27 AM Chris Johns wrote: > > Hi, > > I am trying to build a cross-compiler on FreeBSD with --enable-lto because a > chip vendor is using it when building controller software that is part of a > system. > > The build I am using symlinks gmp, mp

Building gcc 12 cross-compiler with --enable-lto on FreeBSD fails

2022-06-15 Thread Chris Johns
Hi, I am trying to build a cross-compiler on FreeBSD with --enable-lto because a chip vendor is using it when building controller software that is part of a system. The build I am using symlinks gmp, mpfr etc as source so they are built as part of the gcc build. The mpfr package is reporting

Re: GCC 12 miscompilation of volatile asm (was: Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect)

2022-04-11 Thread Jeremy Linton via Gcc
after inlining") ... and all my local tests look good with that applied. Compiler explorer's trunk build now has that fix, so the examples from before now look good: aarch64: https://godbolt.org/z/vMczqjYvs x86_64: https://godbolt.org/z/cveff9hq5 Jeremy, now that the real issue has

Re: GCC 12 miscompilation of volatile asm (was: Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect)

2022-04-11 Thread Mark Rutland via Gcc
mmary after inlining") ... and all my local tests look good with that applied. Compiler explorer's trunk build now has that fix, so the examples from before now look good: aarch64: https://godbolt.org/z/vMczqjYvs x86_64: https://godbolt.org/z/cveff9hq5 Jeremy, now that the real issu

Re: GCC 12 miscompilation of volatile asm (was: Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect)

2022-04-11 Thread Mark Rutland via Gcc
ng investigated. > > > > Jemery originally reported this as an issue with {readl,writel}_relaxed(), > > but > > the underlying problem doesn't have anything to do with those specifically. > > > > I'm dumping a bunch of info here largely for posterit

Re: GCC 12 miscompilation of volatile asm (was: Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect)

2022-04-05 Thread Peter Zijlstra
7;t have anything to do with those specifically. > > I'm dumping a bunch of info here largely for posterity / archival, and to find > out who (from the kernel side) is willing and able to test proposed compiler > fixes, once those are available. > > I'm happy to do so for aarch64; Peter, I assume you'd be happy to look at the > x86 side? Sure..

Re: GCC 12 miscompilation of volatile asm (was: Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect)

2022-04-05 Thread Andrew Cooper via Gcc
On 05/04/2022 14:04, Mark Rutland wrote: > On Tue, Apr 05, 2022 at 01:51:30PM +0100, Mark Rutland wrote: > My x86_64 test case is: > > Per compiler explorer (https://godbolt.org/z/cveff9hq5) GCC trunk currently > compiles this as: > > | msr_rmw_set_bits: > |

Re: GCC 12 miscompilation of volatile asm (was: Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect)

2022-04-05 Thread Mark Rutland via Gcc
et_bits(unsigned long reg, unsigned long bits) > | { > | unsigned long val; > | > | val = rdmsr(reg); > | val |= bits; > | wrmsr(reg, val); > | } > | > | void func_with_msr_side_effects(unsigned long reg) > | { > | msr_rmw_set_bits(reg, 1UL << 0); > | ms

GCC 12 miscompilation of volatile asm (was: Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect)

2022-04-05 Thread Mark Rutland via Gcc
who (from the kernel side) is willing and able to test proposed compiler fixes, once those are available. I'm happy to do so for aarch64; Peter, I assume you'd be happy to look at the x86 side? This is a generic issue, and I wrote test cases for aarch64 and x86_64. Those are inlin

Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect

2022-04-04 Thread Will Deacon via Gcc
hat you are writing to that location of memory. > > > volatile asm does not do what you think it does. > > > You didn't read further down about memory clobbers: > > > https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Clobbers-and-Scratch-Registers > > > Specif

Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect

2022-04-03 Thread Doug Berger via Gcc
forces the compiler to generate the instruction in the code path as intended. The only problem is that it doesn't also tell the compiler that there may be memory side effects. Meaning that if a function is comprised entirely of relaxed io operations, the compiler may think that it only has reg

Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect

2022-04-03 Thread Ard Biesheuvel via Gcc
g this. > > > > > > On Fri, Apr 01, 2022 at 11:44:06AM -0500, Jeremy Linton wrote: > > > > The relaxed variants of read/write macros are only declared > > > > as `asm volatile()` which forces the compiler to generate the > > > > instruction in the c

Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect

2022-04-03 Thread Ard Biesheuvel via Gcc
The relaxed variants of read/write macros are only declared > > > as `asm volatile()` which forces the compiler to generate the > > > instruction in the code path as intended. The only problem > > > is that it doesn't also tell the compiler that there may > > &g

Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect

2022-04-03 Thread Andrew Pinski via Gcc
On Fri, Apr 1, 2022 at 10:24 AM Mark Rutland via Gcc wrote: > > Hi Jeremy, > > Thanks for raising this. > > On Fri, Apr 01, 2022 at 11:44:06AM -0500, Jeremy Linton wrote: > > The relaxed variants of read/write macros are only declared > > as `asm volatile()` which f

Re: [PATCH] arm64/io: Remind compiler that there is a memory side effect

2022-04-01 Thread Mark Rutland via Gcc
Hi Jeremy, Thanks for raising this. On Fri, Apr 01, 2022 at 11:44:06AM -0500, Jeremy Linton wrote: > The relaxed variants of read/write macros are only declared > as `asm volatile()` which forces the compiler to generate the > instruction in the code path as intended. The only problem

[PATCH] arm64/io: Remind compiler that there is a memory side effect

2022-04-01 Thread Jeremy Linton via Gcc
The relaxed variants of read/write macros are only declared as `asm volatile()` which forces the compiler to generate the instruction in the code path as intended. The only problem is that it doesn't also tell the compiler that there may be memory side effects. Meaning that if a functi

Re: possible bug in gcc compiler

2022-03-11 Thread Jakub Jelinek via Gcc
-with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 > > Apple clang version 13.0.0 (clang-1300.0.29.30) This means you even aren't using gcc at all but a different compiler. Jakub

possible bug in gcc compiler

2022-03-11 Thread Larry Jackson via Gcc
I goofed and failed to put a space after the "case" word: switch(nu){ case1: v1 =val;break; case2: v2 =val;break; case3: v3 =val;break; case4: v4 =val;break; } gcc compiler showed NO errors or warnings. Execution of the code produced incorrect results. After I added a space(no oth

Recruitment Letter For compiler developers or maintainers

2022-01-13 Thread Jianhao Xu via Gcc
Dear compiler developers or maintainers, We are writing to see if you would like to participate in a new research study being conducted at Nanjing University. This research plays an important role in advancing our understanding of C programmers' knowledge and views of certain security i

Dear Hohnka M.J., Miller J.A., Dacumos K.M., Fritton T.J., Erdley J.D., Long L.N.: Ιnvitаtion for Paρеr Submiѕѕiοns -- Evaluation of compiler-induced vulnerabilities

2021-10-03 Thread Sally Williams
rtіcle Τіtle: "Evaluation of compiler-induced vulnerabilities" 2. Аrtіcle Keywords: Codes (symbols); Open source software; Program compilers; Security of data; Assembly language; Compilation process; Confidence levels; Machine codes; Persistent state; Security vulnerabilities; Softw

Re: How to avoid that compiler generated objects get optimized away?

2021-07-14 Thread Sebastian Huber
On 14/07/2021 09:33, Richard Biener wrote: I tried to add a TREE_USED (var) = 1, but this seems to have no effect. Could someone give me a hint what needs to be added so that this object is created? The object is placed in a linker set. You can call mark_decl_referenced (var), TREE_USED is only

Re: How to avoid that compiler generated objects get optimized away?

2021-07-14 Thread Richard Biener via Gcc
On Wed, Jul 14, 2021 at 7:50 AM Sebastian Huber wrote: > > Hello, > > I noticed that the following static read-only object gets optimized away > if optimization is enabled: > > /* Generate the pointer to the gcov_info_var in a dedicated section. */ > > static void > build_gcov_info_var_registrati

How to avoid that compiler generated objects get optimized away?

2021-07-13 Thread Sebastian Huber
Hello, I noticed that the following static read-only object gets optimized away if optimization is enabled: /* Generate the pointer to the gcov_info_var in a dedicated section. */ static void build_gcov_info_var_registration (tree gcov_info_type) { tree var = build_decl (BUILTINS_LOCATION,

Dear Hohnka M.J., Miller J.A., Dacumos K.M., Fritton T.J., Erdley J.D., Long L.N.: Ԝеlϲomе to Сontrіbսte Your Original Manսsᴄriрts - Evaluation of compiler-induced vulnerabilities

2021-06-09 Thread Andrew Chang
Miller J.A., Dacumos K..., Hope that you are having a good day. Your рареr entіtlҽd "Evaluation of compiler-induced vulnerabilities" ρᴜblisһed in Jοᴜrnаl of Aerospace Information Systems has impressed us profoundly. *Here, we strongly іnνіtҽ you to сontriƄսte other unρᴜblisһed рареr

Re: Does bootstrap make native compiler faster? Should I always use --disable-boostrap?

2021-06-02 Thread Martin Liška
On 6/2/21 10:10 AM, sotrdg sotrdg via Gcc wrote: The document said yes. However, what does bootstrap actually do that can make compiler faster? Hello. In case of openSUSE, we leverage both bootstrap-lto config with 'make profiledbootstrap'. That utilizes profile-guided op

Re: Does bootstrap make native compiler faster? Should I always use --disable-boostrap?

2021-06-02 Thread Martin Jambor
Hi, On Wed, Jun 02 2021, sotrdg sotrdg via Gcc wrote: > The document said yes. However, what does bootstrap actually do that can make > compiler faster? Assuming the gcc you are bootstrapping is newer than your system compiler, it is quite likely to be better able to optimize itself th

Does bootstrap make native compiler faster? Should I always use --disable-boostrap?

2021-06-02 Thread sotrdg sotrdg via Gcc
The document said yes. However, what does bootstrap actually do that can make compiler faster? Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

Re: compiler

2021-05-02 Thread Frosku
On Sat, May 01, 2021 at 09:51:00PM -0700, Jaime Guzman Gaytan via Gcc wrote: > How can I get the compiler if I don't have internet in my apartment? Depending on what platform you're on, there should be a package (deb, rpm, etc) which you can download at i.e. work or a local library

Re: GCC / GFortran (9.3.0; Cygwin 64) Internal Compiler Error on NINT() Function

2020-08-19 Thread Toon Moene
Thanks. An internal compiler error is always a problem with the compiler itself. I submitted this to our bug tracker (Bugzilla) as Problem Report 96712 on your behalf. Follow it by looking at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96712 Kind regards, Toon. On 8/19/20 4:22 PM, Bernd

Re: GCC / GFortran (9.3.0; Cygwin 64 and Ubuntu) Internal Compiler Error on NINT() Function

2020-08-19 Thread David Edelsohn via Gcc
On Wed, Aug 19, 2020 at 10:34 AM Bernd Eggen via Gcc wrote: > > Hello, > > I realised when I created the small code snippet I accidentally put the > variable "m" in the default integer declaration, I checked it and moving it > (to kind=16) does not make a difference either. > > I also checked on U

Re: GCC / GFortran (9.3.0; Cygwin 64 and Ubuntu) Internal Compiler Error on NINT() Function

2020-08-19 Thread Bernd Eggen via Gcc
the same error message / behaviour. I re-attach the corrected f90 file, which also as a slightly improved loop exit condition. Best wishes, Bernd On Wed, 19 Aug 2020 at 15:22, Bernd Eggen wrote: > Hello, > > I've come across an internal compiler error (in GFortran), concern

Re: GCC / GFortran (9.3.0; Cygwin 64) Internal Compiler Error on NINT() Function

2020-08-19 Thread Jonathan Wakely via Gcc
On Wed, 19 Aug 2020 at 15:24, Bernd Eggen via Gcc wrote: > > Hello, > > I've come across an internal compiler error (in GFortran), concerning the > function NINT(), Then you should be reporting it to Bugzilla, not to this mailing list. > Please submit a full bug repo

GCC / GFortran (9.3.0; Cygwin 64) Internal Compiler Error on NINT() Function

2020-08-19 Thread Bernd Eggen via Gcc
Hello, I've come across an internal compiler error (in GFortran), concerning the function NINT(), I attach a very simple source code that illustrates the error. Essentially I am working with 16-byte integers, and there seems no way to ensure that NINT() returns the correct precision intege

Re: Problem with 64-bit only compiler build

2020-08-12 Thread Paul Smith
On Wed, 2020-08-12 at 15:05 -0500, Segher Boessenkool wrote: > > As usual I've built my own version of GCC, and then I check it into > > Git so that all builds can use this one canonical compiler > > regardless of operating system, etc. > > There's your problem.

Re: Problem with 64-bit only compiler build

2020-08-12 Thread Segher Boessenkool
On Tue, Aug 11, 2020 at 08:01:55PM -0400, Paul Smith wrote: > This is a kind of esoteric problem, but all the more annoying for that. :-) > As usual I've built my own version of GCC, and then I check it into Git > so that all builds can use this one canonical compiler regardless

Re: Problem with 64-bit only compiler build

2020-08-12 Thread Jonathan Wakely via Gcc
On Wed, 12 Aug 2020 at 17:43, Paul Smith wrote: > However, the lib directory is empty in my build. What lives in your > version of lib? All the runtime libs, but I think that's because mingw doesn't use the lib/lib64 split. $ ls -1 ~/gcc/mingw/x86_64-w64-mingw32/lib/ libatomic-1.dll libatomic.a

Re: Problem with 64-bit only compiler build

2020-08-12 Thread Paul Smith
s own internal libraries, > > Not by default, it isn't. I'm not sure what directory that is, but > none of my builds have it. > > Is this a cross-compiler? Mine have PREFIX//lib instead, and > it's not empty (for a 64-bit --disable-multlib build) Sorry, you'r

Re: Problem with 64-bit only compiler build

2020-08-12 Thread Jonathan Wakely via Gcc
what directory that is, but none of my builds have it. Is this a cross-compiler? Mine have PREFIX//lib instead, and it's not empty (for a 64-bit --disable-multlib build)

Re: Problem with 64-bit only compiler build

2020-08-12 Thread Paul Smith
On Wed, 2020-08-12 at 15:37 +0200, Jakub Jelinek wrote: > The important thing is that GCC wants to be relocatable, so most > paths are not hardcoded into the compiler, but depend on where the > gcc driver actually is. One can then just move the whole gcc tree > somewhere else and it

Re: ** POTENTIAL FRAUD ALERT - RED HAT ** Re: Problem with 64-bit only compiler build

2020-08-12 Thread Jakub Jelinek via Gcc
x27;s > installation via symlinks in random ways is something that needs to be > supported. Anyway, the user can always replace the "lib64" directory > with a symlink as well. The important thing is that GCC wants to be relocatable, so most paths are not hardcoded into the compiler,

  1   2   3   4   5   6   7   8   9   10   >