Hi from Kenneth..

2024-09-13 Thread Kenneth Churcher via Gcc
Quick-question! do you shop on am azon.?.

Ken Churcher 
---


Inquiry Regarding -Wrange-loop-construct Warning Behavior in GCC 14

2024-09-13 Thread Sunil Kumar Dora
Dear GCC Community,
I am currently encountering an issue with the -Wrange-loop-construct warning in 
GCC version 14, as well as in earlier versions. It appears that the warning is 
triggered incorrectly for certain loop constructs.
Issue Details:
I have tested the following code, which produces a warning with GCC/G++ 
suggesting the use of a reference:
Test Code:
Link to test code on Godbolt (GCC produces 
warning)
For comparison, here is how Clang 18 handles the same code:
 Link to Clang result on Godbolt  (Clang 
handles correctly)
It seems that GCC/G++ might be checking for trivial copyability rather than 
trivial copy-constructibility, which could be contributing to the issue.
Questions:

  1.  Is this a known issue with the -Wrange-loop-construct option?
  2.  Am I possibly overlooking something in my usage of this option?

If this is a known issue, or if you require additional information, please let 
me know. Additionally, if it would be appropriate to create a formal bug report 
to track this, I would be happy to do so.
Thank you very much for your assistance and guidance.

Thanks,
Sunil Dora


test.cpp.docx
Description: test.cpp.docx


Re: Inquiry Regarding -Wrange-loop-construct Warning Behavior in GCC 14

2024-09-13 Thread Jonathan Wakely via Gcc
On Fri, 13 Sept 2024 at 10:30, Sunil Kumar Dora
 wrote:
>
> Dear GCC Community,
> I am currently encountering an issue with the -Wrange-loop-construct warning 
> in GCC version 14, as well as in earlier versions. It appears that the 
> warning is triggered incorrectly for certain loop constructs.
> Issue Details:
> I have tested the following code, which produces a warning with GCC/G++ 
> suggesting the use of a reference:
> Test Code:
> Link to test code on Godbolt (GCC produces 
> warning)
> For comparison, here is how Clang 18 handles the same code:
>  Link to Clang result on Godbolt  (Clang 
> handles correctly)
> It seems that GCC/G++ might be checking for trivial copyability rather than 
> trivial copy-constructibility, which could be contributing to the issue.
> Questions:
>
>   1.  Is this a known issue with the -Wrange-loop-construct option?
>   2.  Am I possibly overlooking something in my usage of this option?
>
> If this is a known issue, or if you require additional information, please 
> let me know. Additionally, if it would be appropriate to create a formal bug 
> report to track this, I would be happy to do so.

Please file a bug report (and please don't send a mail to both the gcc
and gcc-help lists, very few mails belong on both lists at the same
time - just pick one).

I'm not sure what the heuristic is for triggering the warning, but I
agree that testing for trivially copy constructible might be better
here.


> Thank you very much for your assistance and guidance.
>
> Thanks,
> Sunil Dora


Re: Inquiry Regarding -Wrange-loop-construct Warning Behavior in GCC 14

2024-09-13 Thread Jonathan Wakely via Gcc
On Fri, 13 Sept 2024 at 12:52, Jonathan Wakely  wrote:
>
> On Fri, 13 Sept 2024 at 10:30, Sunil Kumar Dora
>  wrote:
> >
> > Dear GCC Community,
> > I am currently encountering an issue with the -Wrange-loop-construct 
> > warning in GCC version 14, as well as in earlier versions. It appears that 
> > the warning is triggered incorrectly for certain loop constructs.
> > Issue Details:
> > I have tested the following code, which produces a warning with GCC/G++ 
> > suggesting the use of a reference:
> > Test Code:
> > Link to test code on Godbolt (GCC produces 
> > warning)
> > For comparison, here is how Clang 18 handles the same code:
> >  Link to Clang result on Godbolt  (Clang 
> > handles correctly)
> > It seems that GCC/G++ might be checking for trivial copyability rather than 
> > trivial copy-constructibility, which could be contributing to the issue.
> > Questions:
> >
> >   1.  Is this a known issue with the -Wrange-loop-construct option?
> >   2.  Am I possibly overlooking something in my usage of this option?
> >
> > If this is a known issue, or if you require additional information, please 
> > let me know. Additionally, if it would be appropriate to create a formal 
> > bug report to track this, I would be happy to do so.
>
> Please file a bug report (and please don't send a mail to both the gcc
> and gcc-help lists, very few mails belong on both lists at the same
> time - just pick one).
>
> I'm not sure what the heuristic is for triggering the warning, but I
> agree that testing for trivially copy constructible might be better
> here.

This is the condition, so it is indeed using trivially copyable:

  /* Since small trivially copyable types are cheap to copy, we suppress the
 warning for them.  64B is a common size of a cache line.  */
  if (TREE_CODE (TYPE_SIZE_UNIT (type)) != INTEGER_CST
  || (tree_to_uhwi (TYPE_SIZE_UNIT (type)) <= 64
  && trivially_copyable_p (type)))
return;





>
>
> > Thank you very much for your assistance and guidance.
> >
> > Thanks,
> > Sunil Dora


gcc-13-20240913 is now available

2024-09-13 Thread GCC Administrator via Gcc
Snapshot gcc-13-20240913 is now available on
  https://gcc.gnu.org/pub/gcc/snapshots/13-20240913/
and on various mirrors, see https://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 13 git branch
with the following options: git://gcc.gnu.org/git/gcc.git branch 
releases/gcc-13 revision 504c8e4dc26501fb68f0ae784b45dba0f68b4f4a

You'll find:

 gcc-13-20240913.tar.xz   Complete GCC

  SHA256=629ece776a56cfa6485b5ec0c91f3525b15fe6b1040b84d2483506df61e5dff0
  SHA1=87b3c9e7b78358df823c92da2d35fafdfca85337

Diffs from 13-20240906 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-13
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.