[Bug tree-optimization/101854] [11 Regression] Invalid warning -Wstringop-overflow wrong argument

2024-07-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
  Known to work||12.0
   Target Milestone|11.5|12.0

--- Comment #13 from Richard Biener  ---
Fixed in GCC 12.

[Bug tree-optimization/101854] [11 Regression] Invalid warning -Wstringop-overflow wrong argument

2023-05-29 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|11.4|11.5

--- Comment #12 from Jakub Jelinek  ---
GCC 11.4 is being released, retargeting bugs to GCC 11.5.

[Bug tree-optimization/101854] [11 Regression] Invalid warning -Wstringop-overflow wrong argument

2022-12-21 Thread nightstrike at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854

--- Comment #11 from nightstrike  ---
(In reply to Martin Sebor from comment #9)
> Fixed for GCC 12.  The patch is far too intrusive to backport but the
> following should fix the problem in GCC 11:

Would you mind applying it to 11?  Thanks!

Also, I think in your diff below, there's "// A nonnull" that should be "/* A
nonnull"... / to *

> diff --git a/gcc/calls.c b/gcc/calls.c
> index fcb0d6dec69..f116923c890 100644
> --- a/gcc/calls.c
> +++ b/gcc/calls.c
> @@ -2295,14 +2295,15 @@ initialize_argument_information (int num_actuals
> ATTRIBUTE_UNUSED,
>  operand for later processing.  */
>if (attr_access *access = rdwr_idx.get (argpos))
> {
> + int idx = i - !!struct_value_addr_value;
>   if (POINTER_TYPE_P (type))
> {
> - access->ptr = args[i].tree_value;
> + access->ptr = args[idx].tree_value;
>   // A nonnull ACCESS->SIZE contains VLA bounds.  */
> }
>   else
> {
> - access->size = args[i].tree_value;
> + access->size = args[idx].tree_value;
>   gcc_assert (access->ptr == NULL_TREE);
> }
> }

[Bug tree-optimization/101854] [11 Regression] Invalid warning -Wstringop-overflow wrong argument

2022-04-21 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|11.3|11.4

--- Comment #10 from Richard Biener  ---
GCC 11.3 is being released, retargeting bugs to GCC 11.4.

[Bug tree-optimization/101854] [11 Regression] Invalid warning -Wstringop-overflow wrong argument

2021-08-17 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101854

Martin Sebor  changed:

   What|Removed |Added

Summary|[11/12 Regression] Invalid  |[11 Regression] Invalid
   |warning -Wstringop-overflow |warning -Wstringop-overflow
   |wrong argument  |wrong argument
  Known to fail||11.2.0

--- Comment #9 from Martin Sebor  ---
Fixed for GCC 12.  The patch is far too intrusive to backport but the following
should fix the problem in GCC 11:

diff --git a/gcc/calls.c b/gcc/calls.c
index fcb0d6dec69..f116923c890 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -2295,14 +2295,15 @@ initialize_argument_information (int num_actuals
ATTRIBUTE_UNUSED,
 operand for later processing.  */
   if (attr_access *access = rdwr_idx.get (argpos))
{
+ int idx = i - !!struct_value_addr_value;
  if (POINTER_TYPE_P (type))
{
- access->ptr = args[i].tree_value;
+ access->ptr = args[idx].tree_value;
  // A nonnull ACCESS->SIZE contains VLA bounds.  */
}
  else
{
- access->size = args[i].tree_value;
+ access->size = args[idx].tree_value;
  gcc_assert (access->ptr == NULL_TREE);
}
}