public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/100499] New: Different results with -fpeel-loops -ftree-loop-vectorize options
@ 2021-05-10 10:20 dongjianqiang2 at huawei dot com
  2021-05-10 11:13 ` [Bug tree-optimization/100499] " rguenth at gcc dot gnu.org
                   ` (45 more replies)
  0 siblings, 46 replies; 47+ messages in thread
From: dongjianqiang2 at huawei dot com @ 2021-05-10 10:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100499
           Summary: Different results with -fpeel-loops
                    -ftree-loop-vectorize options
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dongjianqiang2 at huawei dot com
  Target Milestone: ---

cat demo.c
#include<stdio.h>
typedef unsigned short uint16_t;
typedef signed int int32_t;
static uint16_t g_2823 = 0xEC75L;
static uint16_t g_116 = 0xBC07L;

static uint16_t
(safe_mul_func_uint16_t_u_u)(uint16_t ui1, uint16_t ui2 )
{

  return ((unsigned int)ui1) * ((unsigned int)ui2);
}

int main (int argc, char* argv[])
{
    uint16_t l_2815 = 65535UL;
    uint16_t *l_2821 = &g_116;
    uint16_t *l_2822 = &g_2823;

    printf ("start g_2823 = %d\n", g_2823);
lbl_2826:
    l_2815 &= 0x9DEF1EAEL;
    if (+(safe_mul_func_uint16_t_u_u(((*l_2821) = l_2815), (--(*l_2822)))))
    {
      goto lbl_2826;
    }
    printf ("end g_2823 = %d\n", g_2823);

    return 0;
}

Compiling with 

gcc demo.c -O1
./a.out
start g_2823 = 60533
end g_2823 = 32768

gcc demo.c -O1 -fpeel-loops -ftree-loop-vectorize
./a.out
start g_2823 = 60533
end g_2823 = 60526

gives different results

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

end of thread, other threads:[~2023-07-07 10:39 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-10 10:20 [Bug tree-optimization/100499] New: Different results with -fpeel-loops -ftree-loop-vectorize options dongjianqiang2 at huawei dot com
2021-05-10 11:13 ` [Bug tree-optimization/100499] " rguenth at gcc dot gnu.org
2021-05-11  9:06 ` marxin at gcc dot gnu.org
2021-05-11  9:07 ` marxin at gcc dot gnu.org
2021-05-11  9:09 ` marxin at gcc dot gnu.org
2021-05-11  9:12 ` dongjianqiang2 at huawei dot com
2021-05-11  9:42 ` rguenth at gcc dot gnu.org
2021-05-11 10:40 ` amker at gcc dot gnu.org
2021-05-11 11:33 ` marxin at gcc dot gnu.org
2021-05-17  2:17 ` amker at gcc dot gnu.org
2021-05-18  9:49 ` rguenth at gcc dot gnu.org
2021-05-18  9:57 ` rguenth at gcc dot gnu.org
2021-05-18 10:25 ` rguenth at gcc dot gnu.org
2021-05-18 11:33 ` amker at gcc dot gnu.org
2021-05-18 11:36 ` amker at gcc dot gnu.org
2021-05-18 11:54 ` rguenther at suse dot de
2021-05-18 15:46 ` amacleod at redhat dot com
2021-05-19  6:31 ` rguenth at gcc dot gnu.org
2021-05-19  7:10 ` amker at gcc dot gnu.org
2021-05-19  7:15 ` amker at gcc dot gnu.org
2021-05-19  8:24 ` aldyh at redhat dot com
2021-05-19 18:11 ` amacleod at redhat dot com
2021-05-22 15:37 ` law at gcc dot gnu.org
2021-05-26  8:14 ` aldyh at gcc dot gnu.org
2021-05-26  8:21 ` aldyh at gcc dot gnu.org
2021-05-26  8:34 ` rguenther at suse dot de
2021-05-26  8:40 ` aldyh at redhat dot com
2021-05-26  8:59 ` rguenther at suse dot de
2021-05-26 13:17 ` amacleod at redhat dot com
2021-05-26 13:23 ` rguenther at suse dot de
2021-05-26 13:30 ` aldyh at redhat dot com
2021-07-22  8:09 ` [Bug tree-optimization/100499] [9/10/11/12 Regression] " rguenth at gcc dot gnu.org
2021-07-22  8:09 ` rguenth at gcc dot gnu.org
2021-07-22  8:11 ` rguenth at gcc dot gnu.org
2021-07-28  9:05 ` rguenth at gcc dot gnu.org
2021-07-29  7:56 ` ebotcazou at gcc dot gnu.org
2022-01-24 13:16 ` rguenth at gcc dot gnu.org
2022-01-24 13:16 ` rguenth at gcc dot gnu.org
2022-01-24 13:17 ` rguenth at gcc dot gnu.org
2022-01-31  8:08 ` cvs-commit at gcc dot gnu.org
2022-01-31  8:38 ` cvs-commit at gcc dot gnu.org
2022-02-04 13:39 ` cvs-commit at gcc dot gnu.org
2022-02-04 13:40 ` [Bug tree-optimization/100499] [9/10/11 " rguenth at gcc dot gnu.org
2022-02-15 12:23 ` rguenth at gcc dot gnu.org
2022-05-27  9:45 ` [Bug tree-optimization/100499] [10/11 " rguenth at gcc dot gnu.org
2022-06-28 10:44 ` jakub at gcc dot gnu.org
2023-07-07 10:39 ` [Bug tree-optimization/100499] [11 " rguenth 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).