public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* One question on the source code of tree-object-size.cc
@ 2023-07-31 16:47 Qing Zhao
  2023-07-31 17:03 ` Siddhesh Poyarekar
  0 siblings, 1 reply; 29+ messages in thread
From: Qing Zhao @ 2023-07-31 16:47 UTC (permalink / raw)
  To: siddhesh Poyarekar, jakub Jelinek; +Cc: Qing Zhao via Gcc-patches

Hi, Sid and Jakub,

I have a question in the following source portion of the routine “addr_object_size” of gcc/tree-object-size.cc:

 743       bytes = compute_object_offset (TREE_OPERAND (ptr, 0), var);
 744       if (bytes != error_mark_node)
 745         {
 746           bytes = size_for_offset (var_size, bytes);
 747           if (var != pt_var && pt_var_size && TREE_CODE (pt_var) == MEM_REF)
 748             {
 749               tree bytes2 = compute_object_offset (TREE_OPERAND (ptr, 0),
 750                                                    pt_var);
 751               if (bytes2 != error_mark_node)
 752                 {
 753                   bytes2 = size_for_offset (pt_var_size, bytes2);
 754                   bytes = size_binop (MIN_EXPR, bytes, bytes2);
 755                 }
 756             }
 757         }

At line 754, why we always use “MIN_EXPR” whenever it’s for OST_MINIMUM or not? 
Shall we use 

(object_size_type & OST_MINIMUM
                            ? MIN_EXPR : MAX_EXPR)

Instead?

Thanks a lot for the help.

Qing

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

end of thread, other threads:[~2023-08-04 19:26 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-31 16:47 One question on the source code of tree-object-size.cc Qing Zhao
2023-07-31 17:03 ` Siddhesh Poyarekar
2023-07-31 17:07   ` Siddhesh Poyarekar
2023-07-31 18:13     ` Qing Zhao
2023-07-31 18:23       ` Siddhesh Poyarekar
2023-07-31 18:36         ` Qing Zhao
2023-08-01 21:35     ` Qing Zhao
2023-08-01 22:57       ` Kees Cook
2023-08-02  0:29         ` Siddhesh Poyarekar
2023-08-02 14:02         ` Qing Zhao
2023-08-03 16:15           ` Siddhesh Poyarekar
2023-08-03 16:43             ` Qing Zhao
2023-08-03 17:19               ` Siddhesh Poyarekar
2023-08-03 17:34                 ` Qing Zhao
2023-08-03 17:51                   ` Kees Cook
2023-08-03 19:55                     ` Qing Zhao
2023-08-04  7:37                       ` Kees Cook
2023-08-03 21:31                   ` Qing Zhao
2023-08-04  7:38                     ` Kees Cook
2023-08-04 13:32                       ` Qing Zhao
2023-08-04 14:40                   ` Siddhesh Poyarekar
2023-08-04 14:42                     ` Siddhesh Poyarekar
2023-08-04 15:27                       ` Qing Zhao
2023-08-04 15:27                     ` Qing Zhao
2023-08-04 16:36                       ` Siddhesh Poyarekar
2023-08-04 19:06                         ` Qing Zhao
2023-08-04 19:09                           ` Siddhesh Poyarekar
2023-08-04 19:26                             ` Qing Zhao
2023-08-02  0:21       ` Siddhesh Poyarekar

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).