* [Bug middle-end/90663] [8/9 Regression] strcmp (&a[i], a + i) not folded for arrays and constant index
[not found] <bug-90663-4@http.gcc.gnu.org/bugzilla/>
@ 2021-02-13 23:53 ` msebor at gcc dot gnu.org
2021-05-14 9:51 ` [Bug middle-end/90663] [9 " jakub at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 9+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-02-13 23:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90663
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|10.0 |10.2.0, 11.0
--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
No progress in GCC 11.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/90663] [9 Regression] strcmp (&a[i], a + i) not folded for arrays and constant index
[not found] <bug-90663-4@http.gcc.gnu.org/bugzilla/>
2021-02-13 23:53 ` [Bug middle-end/90663] [8/9 Regression] strcmp (&a[i], a + i) not folded for arrays and constant index msebor at gcc dot gnu.org
@ 2021-05-14 9:51 ` jakub at gcc dot gnu.org
2021-06-01 8:14 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-05-14 9:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90663
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|8.5 |9.4
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 8 branch is being closed.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/90663] [9 Regression] strcmp (&a[i], a + i) not folded for arrays and constant index
[not found] <bug-90663-4@http.gcc.gnu.org/bugzilla/>
2021-02-13 23:53 ` [Bug middle-end/90663] [8/9 Regression] strcmp (&a[i], a + i) not folded for arrays and constant index msebor at gcc dot gnu.org
2021-05-14 9:51 ` [Bug middle-end/90663] [9 " jakub at gcc dot gnu.org
@ 2021-06-01 8:14 ` rguenth at gcc dot gnu.org
2021-11-24 6:02 ` [Bug middle-end/90663] [9/10/11/12 " pinskia at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01 8:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90663
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|9.4 |9.5
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/90663] [9/10/11/12 Regression] strcmp (&a[i], a + i) not folded for arrays and constant index
[not found] <bug-90663-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2021-06-01 8:14 ` rguenth at gcc dot gnu.org
@ 2021-11-24 6:02 ` pinskia at gcc dot gnu.org
2022-05-27 9:40 ` [Bug middle-end/90663] [10/11/12/13 " rguenth at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-24 6:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90663
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot gnu.org
Summary|[9 Regression] strcmp |[9/10/11/12 Regression]
|(&a[i], a + i) not folded |strcmp (&a[i], a + i) not
|for arrays and constant |folded for arrays and
|index |constant index
Status|NEW |ASSIGNED
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> Anyhow, I suggest to use get_addr_base_and_unit_offset in the gimple
> folder since there variable addresses will not appear literally but
> only in separate SSA defs.
We could also use ptr_difference_const now and see if the difference is zero.
Let me try that.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/90663] [10/11/12/13 Regression] strcmp (&a[i], a + i) not folded for arrays and constant index
[not found] <bug-90663-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2021-11-24 6:02 ` [Bug middle-end/90663] [9/10/11/12 " pinskia at gcc dot gnu.org
@ 2022-05-27 9:40 ` rguenth at gcc dot gnu.org
2022-06-28 10:37 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27 9:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90663
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|9.5 |10.4
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/90663] [10/11/12/13 Regression] strcmp (&a[i], a + i) not folded for arrays and constant index
[not found] <bug-90663-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2022-05-27 9:40 ` [Bug middle-end/90663] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:37 ` jakub at gcc dot gnu.org
2023-05-17 4:56 ` [Bug middle-end/90663] [10/11/12/13/14 " pinskia at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90663
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.4 |10.5
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/90663] [10/11/12/13/14 Regression] strcmp (&a[i], a + i) not folded for arrays and constant index
[not found] <bug-90663-4@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2022-06-28 10:37 ` jakub at gcc dot gnu.org
@ 2023-05-17 4:56 ` pinskia at gcc dot gnu.org
2023-05-17 15:43 ` pinskia at gcc dot gnu.org
2023-07-07 10:35 ` [Bug middle-end/90663] [11/12/13/14 " rguenth at gcc dot gnu.org
8 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-17 4:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90663
--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 55097
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55097&action=edit
Patch which I am testing
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/90663] [10/11/12/13/14 Regression] strcmp (&a[i], a + i) not folded for arrays and constant index
[not found] <bug-90663-4@http.gcc.gnu.org/bugzilla/>
` (6 preceding siblings ...)
2023-05-17 4:56 ` [Bug middle-end/90663] [10/11/12/13/14 " pinskia at gcc dot gnu.org
@ 2023-05-17 15:43 ` pinskia at gcc dot gnu.org
2023-07-07 10:35 ` [Bug middle-end/90663] [11/12/13/14 " rguenth at gcc dot gnu.org
8 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-17 15:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90663
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |NEW
Assignee|pinskia at gcc dot gnu.org |unassigned at gcc dot gnu.org
--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #10)
> Created attachment 55097 [details]
> Patch which I am testing
Hmm, one failure
+FAIL: c-c++-common/Wrestrict.c -Wc++-compat memcpy (test for warnings, line
120)
GCC's code says:
/* Avoid diagnosing exact overlap in calls to __builtin_memcpy.
It's safe and may even be emitted by GCC itself (see bug
32667). */
Reduced testcase for the missing warning:
```
/* PR 35503 - Warn about restricted pointers
{ dg-do compile }
{ dg-options "-O2 -Wrestrict -ftrack-macro-expansion=0" } */
void sink (void*, ...);
/* Exercise memcpy with constant or known arguments. */
void test_memcpy_cst (void *d, const void *s)
{
struct {
char a[7];
char b[7];
char c[7];
} x;
sink (&x);
d = x.a + 7;
s = x.b;
__builtin_memcpy (d, s, 3); /* { dg-warning "\\\[-Wrestrict"
"memcpy" } */
sink (&x);
}
```
I am no longer working on this because I am not 100% sure if we want to still
warn here or not ...
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/90663] [11/12/13/14 Regression] strcmp (&a[i], a + i) not folded for arrays and constant index
[not found] <bug-90663-4@http.gcc.gnu.org/bugzilla/>
` (7 preceding siblings ...)
2023-05-17 15:43 ` pinskia at gcc dot gnu.org
@ 2023-07-07 10:35 ` rguenth at gcc dot gnu.org
8 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90663
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.5 |11.5
--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.
^ permalink raw reply [flat|nested] 9+ messages in thread