Apology to Dr. Elena Zannoni

2022-12-29 Thread David Edelsohn via Gcc
At GNU Cauldron 2022 during the GNU Toolchain Infrastructure BoF session I
displayed inappropriate and uncharacteristic behavior towards Dr. Elena
Zannoni. Because I realized that my behavior was inappropriate, I
proactively apologized to Dr. Zannoni during a conversation immediately
after the BoFs.  She graciously accepted my apology and responded
that everything was okay.

I wish to reiterate my apology publicly to her. I am sorry if the incident
might have caused anyone discomfort at the event, or about GNU Cauldron or
the GNU Toolchain community.  I will be more careful in the future.

Happy Holidays and Happy New Year,
David


Re: Difficulty in implementing a GCC plugin for [[invariant]] contract functions in classes/structs without prior experience?

2022-12-29 Thread Gavin Ray via Gcc
So I have prototyped the code here, there are two places where I am
confused:
GCC [[invariant]] plugin for Design by Contract (WIP) (github.com)


1. Is it proper to cast like this?

tree args = NULL_TREE;
tree tmp_tree = NULL_TREE;
vec** args_ptr = (vec**)&args;

tree call = build_new_method_call(class_type, id, args_ptr, fun->decl,
LOOKUP_NORMAL, &tmp_tree, tf_warning_or_error);

2. At the bottom, I want to call "invariant()" before "return", but I'm not
sure how to phrase this in code. The following doesn't work quite right:
because you can't compare "gsi_stmt()" and NULL_TREE

// If the last block is a return block, insert the call before the
return statement.
if (gsi_stmt(gsi) != NULL_TREE && gimple_code(gsi_stmt(gsi)) ==
GIMPLE_RETURN)
gsi_insert_before(&gsi, g, GSI_SAME_STMT);
else
gsi_insert_after(&gsi, g, GSI_SAME_STMT);




On Thu, Dec 29, 2022 at 10:37 AM Gavin Ray  wrote:

> Hey all,
>
> The feature I appreciate most about the D programming language is its
> "Design by Contract" feature.
> Contract programming - Dlang Tour
> 
>
> With the recent merge of Contracts to GCC master, C++ comes close to this,
> with support for function-based contracts.
> The most powerful contract though, is the "invariant" contract:
>
> *invariant() is a special member function of struct and class types that
>> allows sanity checking an object's state during its whole lifetime:*
>
>
>>
>> *- invariant() is called after the constructor has run and before the
>> destructor is called.*
>> *- invariant() is called before entering a member function*
>> *- invariant() is called after exiting a member function.**- Class
>> invariants are inherited. That means that a derived class invariant will
>> implicitly call the base class invariant.*
>
>
> I'm very interested in prototyping a GCC plugin to implement support for
> transforming all member function calls in class/struct types
> such that a call to the [[invariant]]-annotated function (if any) is
> placed at the beginning and end of method bodies.
>
> Does anyone have any idea whether something like this would be suitable
> for a first plugin,
> or if there would be roadblocks/technical challenges to implementing such
> a thing?
>
> I'd be grateful for any advice.
>
> Thank you,
> Gavin =)
>
>


gcc-10-20221229 is now available

2022-12-29 Thread GCC Administrator via Gcc
Snapshot gcc-10-20221229 is now available on
  https://gcc.gnu.org/pub/gcc/snapshots/10-20221229/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 10 git branch
with the following options: git://gcc.gnu.org/git/gcc.git branch 
releases/gcc-10 revision 3d51d241b322ea606b5adc9d617d700485d13be9

You'll find:

 gcc-10-20221229.tar.xz   Complete GCC

  SHA256=99d286cc6bd71d0a7bcbf2165d67ab19e261727fdd02eeab49dce435a7f7781f
  SHA1=2d86079186cf9e3be9281ce59007a19aaaeb5f05

Diffs from 10-20221222 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-10
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.